Marketing and something called "perceived quality." The Germans are the best at it: soft touch surfaces, dampening on doors and glove boxes, switch gear that satisfyingly clicks, and so on. All of these give you the impression of luxury and quality, when in reality the likes of Audi and BMW languish in the bottom quartile of reliability tables and largely use the same innards e.g. Ford make cars that are more reliable and cheaper to maintain yet the German marketing machine wins out.
They do generally offer good engines, gearboxes , suspension and steering e.g. bmw are darn good for a mass produced car in all these areas. But enough to command a premium over say a Mazda that does more or less the same?
The Germans built brand power in the 70-90's positioning themselves as upmarket, then decided to move in to mass market Ford, Vauxhall territory. It's worked like a charm, but make no mistake the quality is comparable to these budget brands.
Porsche are genuinely premium for example.