Apple was trying and failing for many years. Now they have found a bigger niche in little electronic devices. Good for them! But let's not pretend the earlier failures were all intended as some kind of grand strategy. Apple is not a perfect unicorn. It's just another company, selling products.
I'm pretty sure there was a plan at the very beginning of the Jobs era, to get the Mac line profitable again just to keep the company going long enough to go after new and different product lines. About a year before returning to Apple, Steve Jobs even publicly outlined this strategy:
"If I were running Apple, I would milk the Macintosh for all it's worth -- and get busy on the next great thing. The PC wars are over. Done. Microsoft won a long time ago."
-- Fortune, Feb. 19, 1996