Anyone going to dealerships in 2019 is already losing. I made that mistake recently with my wife's car. We went into dealer and I talked to manager. We knew exact model and color we wanted and told him we were there to see it in person and then would get quotes from area dealers... Because he was nice I told him to just give me his absolute best price then and we'd consider it... it was few grand more than I knew I could get so I went the email/quote route. 2 weeks later he won the pricing quote and was 6 grand lower than what he said was his lowest in the showroom. Only shop via email. Ever.
Reminds me when I bought my second car. I wanted to test drive 2 different cars at a couple dealerships. I called ahead to the first one and asked if the model I wanted was available. They said yes, and asked what I wanted to pay for it. I totally low-balled them because I didn't care at this point. When I got there they gave me the price I offered. Never test drove the second car...
That case seems like it'd be driven by different factors -- car dealerships need lots of space to store all those cars, so they gravitate towards locations where land is cheap; they want to be close to a highway exit, to make taking delivery of new cars easier; there may be local law/zoning issues that limit where businesses that do things like car maintenance on-site can be located; etc.
When I shop for a new car, I go to "auto row" where the dealers are clustered, then it's easy to comparison shop. If I go to a dealer with nobody near, then it's harder. The dealers know this when siting their business.