Here's how the PAPI lights work:
Depending on the angle of the viewer, a different color is seen:
Then each light is calibrated to an angle:
The good thing about this is that it's dead simple technology where very few things can go wrong: The lights have to be on and calibrated for the correct angle. The downside is that its usefulness decreases with lower visibility.
Some new systems appear to have solar panels as an off grid (and alternative/backup) power source which is of course very sensible, and made easier by that many systems today have LED lights.
Or are the lights set for the closer airplane?
The great advantage of the system is that it is passive, in other words it never makes contact or note of the aircraft approaching. It lights up all to all aircraft in the beam. However the system may not be completely static, some new systems feature FAROS (Final Approach Runway Occupancy Signal) giving an indication that the runway may be occupied by another aircraft by flashing the lights.
For a little information on differences between similar systems to PAPI, see this link.