Ants invade cars because they deem them to be a viable food source. They might have randomly stumbled upon your car in search of food or water or they may have been following the scent trail left by fellow foragers who are already inside searching for snacks. In either case, ants can cause quite a bit of damage to your vehicle if they chew through wires or upholstery.
The first thing you should do when you notice ants in your car is comb it through and get rid of all the food sources that could be attractive to ants. This could be anything from an old candy wrapper to a stray fast food container or even a smear of sugar on the side of your cup holder. Once you have eliminated the food sources, vacuum and wipe down your entire vehicle including any storage areas such as the trunk or glove box.
Next, use ant baits in multiple places throughout the interior of your car (in a secure location away from children or pets) and also outside on the ground where you park. This will confuse the ants and make it difficult for them to follow your scent trails back to your car. After a week or when you no longer see any ants, consider using NO Ants Barrier Spray on the underside of your car and in all wheel arches, door jams, engine bay and other hard-to-reach areas to stop the ants from entering your vehicle again.