Small correction... It's magnetic, like a guitar pickup. They're getting away from that around here, and going with cameras. When you see a white camera on the cantilevered arm, it's most likely for sensing traffic.
I don't completely trust the the optical system. Seems like it would be a trivial upgrade to include a tag reader, and they'd be able to track the population across the country.
Yup. Loop detectors.
Inductive loop goes in the roadbed, a detector senses when a magnetic object (most likely a vehicle) is present, and adjusts the light's behavior accordingly.
Some work differently than others. I've observed, at least around here, that the lights will lock in their "decision" once the green lights change to yellow - so even if you get your car over the sensor, it won't trigger a left turn signal if you got there while the lights were cycling.
Other lights won't trigger until a car's sat there through a complete cycle.
Another left turn signal will turn on longer due to the presence of a second loop farther back - if a lot of cars are lined up to make a left turn, the light stays on longer.
Then it gets really damn cold and the systems stop working (relays start sticking, loops break, I don't know what), and then the loop detectors don't sense
anything, so you have to sit and wait for the system's timer to expire, and after 2 minutes of just sitting there doing nothing, the thing finally changes.
They can put a man on the moon but I have to sit at a red light at 3 AM when there is no one else in sight!
Some intersections here are nice: They switch to flashing yellow lights along the primary road, and flashing red for the lower-volume road.