Honesty the manufacturers would make a ton of money if the cut out the dealers. No floor plans to worry about, no dealer markup to worry about, etc. but like has been said above the dealers managed to get laws in place to keep that from happening.
I avoid dealers at all costs. If I can buy lightly used private party, I’ll do it every time. The amount of BS the dealers stack in cars these days is nuts.
I took this screenshot of the mandatory “fees” in a used car locally at a dealer. By the time you tack on their BS, and pay taxes this car will end up creeping close to 25k.