Water hammer, abbreviated as WH, occurs when a valve is suddenly opened or closed. This can creates a repeating pressure wave of the liquid in the pipe that could cause a rupture to the pipe or even damage equipment. As a liquid is traveling through the pipe at a high pressure and the valve is suddenly closed, the flow and pressure come to a sudden stop dropping both to 0. When the valve is closed slower the pressure has a chance to equal out. The resulting sound created is like a hammer, hence water hammer.
Most people are familiar with water hammer in the home when a faucet is shut off or the toilet is flushed, that's the banging or rattling sound you hear in the pipes.