We can consider "a lot of cars" as a plurality of cars, and use those.
We can consider "a lot of cars" as a singular "lot", and use that.
Synesis or notional agreement is where we use a grammatical number not of what is plainly stated (the plurality of cars) but of what is implied (the single "lot"). The fact that "a lot" contains a singular article (a) adds to this implication.
A significant thing here is that we are focusing upon the concept of lot as important in itself. Because this is what we are remarking upon, we're more inclined to consider a lot than cars when matching the number.
A lot of cars have cruise-control.
*A lot of cars has cruise-control.
Here we're focusing more upon something to do with the cars themselves. For this reason the plural form sounds clearly correct, while the singular sounds wrong.
A lot of sweets is an okay present if you can't think of anything else.
*A lot of sweets are an okay present if you can't think of anything else.
*A lot of sweets are okay presents if you can't think of anything else.
Here we're focused again upon the singular "lot" of sweets, and further making of it a single present, and singular agreement works while plural does not.