It serves as the second hot wire in the switch loop. That is called a three way switch.
How To Identify The Common Wire In A Three Way Switch Control
Black screw on light switch. You should also see a green. You should see two black wires each connecting to a different screw on the right side of the switch. These are called terminal screws. This type of switch has two brass screws usually on the bottom and a copper or black screw on the top left. The grounding wire is connected both to the switch using a pigtail wire and to the second cable run passing onward to the next switch. The black is power and the other two are called.
You could install regular lighted switch that does not requires neutral. The green or bare copper ground wire if the device has one attaches to the green screw terminal on the switch or to the electrical box. The switch simply interrupts the current so it doesnt matter to which terminal you connect either wire. This wire is sometimes red. The black wire from the new cable connects to the black hot wire in the fixture box and to one of the terminals on the single pole switch. On the other end the two white wires are wire nutted together.
The black wire from the circuit breaker panel gets attached to the black screw on the 3 way switch. The black and red wires from the white cable running between the switches get connected to either of the two brass screws on the switch. Observe the layout of the wires. At this first switch the black feed wire is connected to the common screw on the switch. If the switch box is metal it also must be pigtailed to the grounding wires. A three way switch is different.
The only downturn is that it will be light when the switch is off. This type of switch lets you turn the light off or on from more than one place in the room. Ideally the old switch is still there so you can wire the new one up the same way as the old one. The white wire from the new cable connects to the fixtures hot wire terminal or hot wire lead and to the other screw terminal on the switch. Connect the black wires to the switch terminals. Its used in conjunction with another 3 way switch in another area and they both control a light or set of lights.
The black hot wire goes to the brass screw or into the hole in the back of the device on the same side as the brass screw. If you only have black and white wire in the switch box that means there is no neutral coming in the box and unfortunately you can not install pilot light switch.