Any object that has live electrical circuits will produce magnetic fields and a car or truck has multiple live circuits.
There are options to minimize EM interference (twisted pairs/grounded foil sheathing encasing them) but this only works for...
Actually, it’s a characteristic of a flux gate compass. They occasionally need recalibration to the Earth’s magnetic field, which also changes between locations. That’s why you have to do that stupid drone dance if you travel very far between...