Its from when cars were new and it was hard to convince people to buy them to start with instead of just using their horses and buggies and manufacturers didn't spend money on marketing or shipping or sales outside of the local area. So independent car dealers setup shop, bought cars, shipped them across the states, marketed them, trained mechanics to service them, built gas stations, and built a customer base. Then as soon as all the marketing was done and sales started picking up in the area the manufacturer would pop in, undercut the local dealer who just spent all the money marketing and showing off cars and building up stock, buy out their skilled mechanics, and left the dealer with all the debt from advertising and training that they could no longer pay off.
For awhile they got away with it, but eventually it became obvious as to what manufacturers were doing and not having to advertise and built up a local car and mechanic and gas supply economy, so legal protections were put in place to protect the independent dealers from getting shafted.
Of course add on another 100 years of political fuckery all around the industry and you get the mess of today.