Tesla makes better software right now. But the profit-margins argument seems to be a misconception [1]. Until Tesla distances itself from Musk, I also don't think the brand will stay 'cool' for that long.
I don’t think those are fully like to like comparisons though. You have to run those numbers just for electric. Nobody I know would cross shop a Tesla and a Rav 4. They can have their margins on their ICE catalog but they don’t have it on their electric yet even with the dealer network numbers added in.