Tesla also runs much higher margins than competitors. They could be cheaper, but they choose not to be.
After a quick search...
Ford's gross margins are about 8%.
GM is about 7%.
Kia is about 8%.
Toyota is about 9%.
Tesla is around 25-30%.
Rivian is around 2% it looks like (but they also build the Amazon fleet, which seems to not be included in the numbers I could find quickly).
Note that the legacy auto numbers are what the main company profits, not dealerships. The newer companies can pocket that directly.
A primary reason is newer companies like Tesla and Rivian are still building their manufacturing capabilities. That additional profit is going towards that expansion.