system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How are magnets in the road used to regulate traffic lights?

I was at a traffic light and I could help but notice that there were a bunch of metal lines in the road. I 'm assuming that the lines are magnets or something that helps the traffic lights to know when to switch. I was just wanting more detail on exactly how the system is supposed to work.
gpt
Traffic light sensors, at least historically, are specialized metal detectors embedded underneath the road. They don't use magnets specifically, but they detect how the presence of metal in a car above it alters the electromagnetic properties of the space around the coil. 

However, most municipalities are moving away from these kind of sensors though, in favor of miniature radar based sensors that mount to the signal post itself.

Under-road type sensors are extremely  expensive to fix when they do fail, as this usually requires tearing up the road for at least 24 hours  (and thereby obstructing traffic.)

Having a small radar sensor that mounts above ground, which you can replace in 20 minutes with a cherry-picker? This is a no-brainer.