Carfax is only as good as what's reported to them. They data mine the insurance companies, state DMVs and manufacturer warranty records to generate their reports. Unfortunately, there's plenty of shady types out there who will do their best to cover their tracks and that's where Carfax is useless.
I saw one truck which sustained major damage while on a car carrier. The truck driver was already on probation with the truck line and would have lost his job if it were reported. He dropped the truck off at a body shop which repaired it at his expense and they did a damn good job, too. He then loaded it back up and delivered it as new. It went through PDI with no red flags being raised. The truck was sold, the new owner was installing speakers in the front doors and found evidence of the bodywork. Guess who got stuck with it after it was sold and the damage was discovered? Yup.

