Automatic train protection is a system that brakes a train by itself if the driver passes a red signal or goes too fast. India's own system is called Kavach. It was developed by RDSO, the Research Designs and Standards Organisation, which is the technical body of Indian Railways, together with Indian companies.
The idea is simple. Human drivers can make mistakes, for example in fog or after a long shift. The system does not depend on the driver's attention. Kavach has three parts. First, small tags are laid between the rails along the track. Each tag tells a passing train exactly where it is. Second, equipment at stations and signals sends radio messages with the state of each signal and the speed allowed. Third, a computer in the locomotive receives the tag readings and the radio messages and compares them with the train's real position and speed. If the train is about to pass a red signal, or is going faster than allowed, the computer applies the brakes without waiting for the driver. Kavach also warns the driver in the cab and sounds the horn automatically near a level crossing.
Take, for example, a goods train approaching a station near Ambala on a foggy winter morning. The driver cannot see the signal, which is red. The onboard computer receives the signal's state by radio, sees that the train is still going at 60 kilometres an hour, and applies the brakes. The train stops before the signal. (The speed here is only an illustration.)
Train protection is a safety layer on top of railway signalling. Signalling shows the driver when to stop. Protection stops the train if the driver does not. It acts on the train's brakes, so the two must be fitted together and tested together. The equipment has to be installed on both the track and every locomotive, so Indian Railways fits it route by route, starting with its busiest lines.
Because lives depend on it, the software must pass strict safety certification. The work is bought through tenders. Read more about the whole setting under railway technology.