During the First World War, German submarines, or U-boats became a serious hazard to Allied shipping.
In response, the British developed depth charges to deal with the U-Boat menace. The very first depth charges were the size of an oil drum filled with TNT and simply dropped over the side of a ship. The explosion was detonated by a preset hydrostatic valve as the charge sunk, sending off a violent pressure wave in the vicinity of the submerged submarine. Even at some distance, a depth charge could cause severe damage and if close enough, the explosion could cave in the pressure hull.
Eventually a mortar was developed to fire the depth charges through the air to where the submarine was expected to be. During the Second World War, the Royal Navy developed the Hedgehog which fired several mortar bombs in a dispersal pattern that would explode on contact with the hull of the submerged U-Boat.