When a column of moving liquid (water?) (usually quickly) is suddenly stopped (the likes of a check valve - some worse than others)the energy of this column reverberates (back and forth) along the pipe line until dissipated - "hammer" is the result - much banging and crashing.
Usually a rethink of design as opposed to arrestors(like shock absorbers) is the go