TestObjectWalking

Can somebody please explain in simple terms how the camera is being stuck to the terrain. I know it has something to do with the processPick() method but i don't understand how it works.