1. Cars were a lot crappier than currently. 2. Shipping replacement parts was slow and expensive. 3. Communication was expensive, long distance calling, or slow, post. 4. Mass marketing was not fined tuned as now.
Dealers thus provided a service. They stocked parts performed quality warranty work. Sold and marketed the manufacturers cars.
Gasoline powered cars tend now to be very reliable, especially if you stick with manufactures that specialize in low cost of ownership cars. cough Toyota cough. The advent of electric cars will likely push reliability even further.
The other thing that's happened with cars as well is price transparency. Dealer could make work for themselves by specializing in getting better prices for the manufacturers cars then they could if they had a unified price list.
Or could Tesla, in their showroom, if they can't sell directly, let people preorder then redirect them to the cheapest local car dealer, in a sort of auction to the lowest margin, so cardealers are only seen as a commoditized cost?