A submarine is a boat that travels under water. Another word is submersible, because submarine is more a term used by the military, by soldiers. Even in ancient times, people tried to be able to stay under water for a long time. Perhaps the first submersible in history was a boat from the Netherlands in 1620. Again and again there were plans and also attempts to build something like this.
However, it was difficult to make the boat really watertight and, above all, to propel it. Only muscle power was not enough. Moreover, the people in the boat had to be able to breathe. The boats were too slow to be of much use in the war. Electric motors were needed that were small but also powerful.
The real era of submarines only began in the years shortly before 1900, when the technology was ready. Many countries wanted such a boat, with which you could sneak up on ships and make them sink. In the First World War and also in the Second World War, this was often successful. However, ships also defended themselves by dropping bombs in the direction of the submarine.
Today, many submarines are very large. Some are powered by nuclear energy, which means they can stay underwater for months. Submarines are often used for reconnaissance, to find out what other countries are doing underwater. Only a few submersibles are used for research: they can be used to find out what nature looks like under water or to find sunken ships like the Titanic.