What exactly does `update-alternatives` do?

view story

http://askubuntu.com – What is the command update-alternatives used for? Take this example: sudo update-alternatives --install /usr/bin/java java /usr/local/java/jre1.7.0_09/bin/java 1 What does it do? How is it different from adding jdk to the path? Let's say that I have run the command. How would I revert back to the original state? (HowTos)