Yeah, cars are bench-tested. They also measure the pollutant levels in the same way, but I don't know if they do it on the same runs as the fuel consumption tests.
Without bench tests it'd be impossible to have repeatable results, as air temperature and humidity, traffic flow, changes in tire wear etc. would all affect a test ran in the real world.
Thus, the results usually seem to be removed from the real world. I'd use them just to estimate the differences between different engines in the same car model or between the models of a given brand, but not between different brands.
I've rarely gotten close to the factory figures, mostly due to my aggressive driving style. Factory figures for my current car are around 6,5 l/100 km extra urban, 11 urban and 8,5 combined.
I drive around 50/50 urban/extra urban, with an average fuel consumption of 11 l/100 km.
My smallest consumption was in a 900 km run with the tankful used between 200-700 km averaging 7,3 l/100 km. And that was a cool autumn night, with no traffic, near optimal air temp for the engine and cruising speed between 100 and 150 km/h.