When you witch a water line, you are using a divining rod to locate underground water. The rod is usually made of metal, and as you walk along the ground, it will dip down when it comes over an underground water source. You can then use this information to dig a well or install a water line.
The exact science behind how witching works is still debated, but some say that it is due to the electrical conductivity of underground water. When the divining rod comes into contact with water, it completes an electrical circuit between the ground and your body, which causes the rod to move. Others say that it is simply a matter of subconscious muscle memory; as your body moves across the landscape, your muscles will naturally tense up when they come over an underground water source.
Regardless of how it works, witching is still used today as an effective way to find hidden groundwater sources. If you're interested in trying it yourself, there are many tutorial videos and guides available online.