In the USA it's also the case that cities have legal zones for certain types of business. Thus auto dealerships are clustered together because that's the only zone they are permitted to operate in. Likewise, in many cities, hotels are similarly clustered. Shopping malls are artificial clusters, though in general an attempt is made to house at most two of any particular sort of outlet, in order to maintain sufficient diversity to attract adequate footfall.
As for franchise restaurants, McDonalds spends huge sums modeling foot and auto traffic to determine the optimal location for its McSlop outlets; Wendy's merely tries to locate itself as close as possible to a McDonalds and thus free-ride on their expensive research, which is another form of pareto optimization on the cheap.