The latter, the insurers share information via a central database, probably the same one that the ANPR system uses to flag up uninsured vehicles and the one the "Tax Disc" system uses to check when you pay up etc.
Don't know how much information that central database holds about individuals but I'd expect at least a basic accident records (date, at fault or not) and convictions. Wouldn't be surprised if the information started with your inside leg measurement though...