They loved the warmth of the engine in winter. They'd climb up into the engine bay and hang out throughout it, bringing along nesting material, aka trash.
To try get rid of them, I tried the typical bait boxes, specialized rat traps, regular rat traps, peppermint, moth balls, a motion sensor light underneath the car, and more. The only thing that really worked was sending so many rat reports to the city that they had to keep coming out to bait the burrows in the neighbors small yard, until they likely talked to the owner directly to do something about it. I had talked with the guy briefly once and asked him about the rats (that were obviously only coming from his small backyard), and his response was pretty much "well it's the city so yeah they're around." Pretty sure one of his tenants also abruptly moved out because the rats chewed through their car too.
The lack of awareness from the guy contributed to me moving out of the city for good. Couldn't stand playing the lottery of good neighbors when most were either renters or inept owners, or a combination of both.