Anti-submarine missiles usually include a jet or rocket engine and a warhead aimed directly at a submarine.
Before World War II, shipboard sonar was unable to maintain contact with a submarine at close range.
Various mortar-type projectors, including Hedgehog and Squid, were devised during World War II to allow a ship to maintain sonar contact while lobbing explosive charges toward the submarine.
[1] During the Cold War, missiles were developed to provide greater range with reduced recoil.
Some missiles and rockets, such as Red Shark carry homing torpedoes to provide terminal guidance for the warhead.