Two things about dealerships:
1. The "back end" - Parts, Service, Body Shop (if they have one) - basically support the New & Used Depts, which in most cases can't stand up on their own.
(Incentives, advertising, promotions, payroll)
2. Brick & mortar costs more than internet.

I'm not defending a 40% markup, but that's what's behind the price differences.
A smart dealership Parts Dept Manager will do both walk-in/account and internet business.
Heck, 20% is better than no sale.
But they don't all think that way.