Many believed the AI boom had passed Apple by. The company was just biding its time.