There are two main ways which arriving cars are detected at traffic lights. Firstly, there are sensors in the road surface. However they don't detect pressure. Instead, they use an inductive loop, which creates a magnetic field and then detects the change to that field when a vehicle passes over the loop.
Secondly, there are radar detection systems mounted on the top of the traffic lights. These transmit a beam, which is reflected back by oncoming vehicles.
Neither system has anything to do with headlights.
Chris