Dealerships make their money with service and financing and parts, not by selling cars. They know many people think they have to go to the dealership for service and milk that for all they can. They also make money selling extras like extended warranties and add-on features.
In terms of service, Elon Musk stated his goal is for service not to make a profit. This is the exact opposite of dealerships where one of their main revenue sources is service.
I can give an example of this. I damaged one of the roof panels on my Tesla model S. The roof panel is painted with a clear-coat. The cost for the part was $175. I spoke to a friend of mine who used to work at a Lexus dealership. He told me the same part would have cost many times that amount. The labor to replace it was also fairly reasonable. By comparison, my experience with Toyota with my previous car, a Prius, was far higher.
For example, shortly after the 3 year/36 month warranty ended (but within the 7 year 100K mile warranty), the HID headlights went out. This was a well-known problem with the Prius. The headlights were not designed to be easily replaceable since HIDs are supposed to last a very long time. Anyway, Toyota wanted $200 per bulb and $140 in labor to replace it. I went online and found the same exact Sylvania bulb for under $50. I ended up going to another dealership to have the work done (having bought my own bulbs) and they replaced it under a "good-will" warranty (which my local dealership did not want to do).
In another case, after I sold my Prius to my parents, the touchscreen stopped working. This is caused by a known design defect where a solder connection breaks over time. Toyota wanted $5000 for a new touchscreen and $2000 in labor to fix it. I removed the touch screen in under 5 minutes. I found a place online that repairs them with a lifetime guarantee for $400 and had that done then spent under 5 minutes re-installing the touchscreen. $2000 in labor is utterly insane. I basically undid one screw, popped a few panels and undid a couple of bolts and that was it. $5000 for the touchscreen is also insane. It probably cost Toyota no more than $300 to make and probably well under that.
Another thing the dealership wanted $1800 for the extended warranty. I went online and bought the same factory extended warranty for $1000. Anytime I needed a part, Toyota would charge outrageous amounts of money for it.
Oh, and Toyota would always try and push a bunch of unnecessary maintenance but give me trouble for known issues that would come up (like a water pump that went bad twice).
I later got a notice over the headlights that there was a class-action because dealerships were charging people to replace the ballasts when there was nothing wrong with them when the HIDs died (Toyota had a bad batch of bulbs). Many people were charged a lot of money to replace the ballasts which were never the problem.
My experience with Tesla has been very different. They never pushed me to buy add-on options or extra service. The service costs were also generally reasonable, though some things like tires are cheaper elsewhere (I like Tirerack). This is what the dealerships fear. My car needs service once a year or every 12.5K miles. A Tesla tech told me that the electric motor is lubricated for 12 years. There's no transmission or regular oil changes needed and even the brakes get a lot less use. There is far less to go wrong mechanically. Even the battery will last a very long time. I'm coming up on 5 years 60K miles and haven't noticed any reduction in range. This is not what dealerships want to sell. Hell, Tesla will even honor the warranty if you don't service the vehicle every year.