In Apple's case cars are far afield from their normal expertise, which is computing. Cars are already a low-margin product for most of the industry. Apple's management may have decided they could be better off not participating at all. Or buying a non-controlling stake in some other EV or car company instead of distracting management with a completely alien business and product line.
Jeff Bezos had good product/leadership sense but above that, had genius financial engineering sense. He knew exactly what the company needed to look like on paper every step of the way for it to become the behemoth that it became.
There aren't any RIM-like companies in the car industry right now. And cars aren't really very useful as computers. Or at least not more useful than phones and tablets and laptops.
They simply thought it was too hard and went back to what was already working.