Ships up until the last 125 years or so were made largely out of wood. Beginning in the late 1800s, ship builders transitioned from wooden frames with wood planking, to iron frames with wooden planking, to iron construction, and then steel, and finally fiberglass, and even more exotic materials.
The ocean is host for many living creatures, ranging from microscopic plankton to the giant whales and squid. Very young animals, especially invertebrates (animals that don't have an internal skeleton), make up much of the plankton broth. Invertebrates like barnacles and mollusks need places to call home. They affix themselves to a hospitable object and grow into adults.
Likewise, seaweed starts out as part of the plankton and needs a suitable object to attach itself and grow to maturity.
Ships make the perfect place to call home. Barnacles glue themselves to the hull of a vessel and open their armored shell in order to strain seawater for food. The shipworm, or the Teredo worm, is a mollusk that burrows its way into wood and progressively weakens the wood as it grows and has to increase its burrow. In tropical climates, shipworms grow very quickly.
The growth of the marine life also had a detrimental effect on speed. Ship hulls that were floating ecosystems simply had too much marine life dragging through the water. A slowdown of three to five knots an hour could mean that a ship would cover between 72 to 120 miles less a day on an ocean voyage.
That could mean that food and water could give out over long voyages. A slower ship could also make for easier prey for faster vessels. For merchants, fast ships also meant more profits as quicker round trips could mean more cargo sold.
Consequently, wooden ships have to be regularly hauled out of the water to have their hulls scraped, sanded and sealed. This process is called careening. To careen a vessel, the crew would have to find a suitable beach where the tide could allow the vessel to gently setting on one of its sides. Heavy objects were taken from the vessel and sometimes parts of the masts were removed. The crew would then scrape off all the living organisms, sand the wood, and then seal it with tar. The the crew would float the vessel and allow it to gently rest on its other side so it too could be careened. It was messy slimy work that had to be done often.
In locations where gently sloping beaches weren't available, careening wharves were built to provide a suitable place to clean ship hulls. In Port Royal, Jamaica, ships used a beach on the inside of the Palisadoes tombolo. At English Harbor, Antigua, careening wharves for the English Royal Navy were in operation by the early 1730s.
Even with an attentive crew, a wooden ship normally lasted a few decades. Ships that used resistant woods were built where available. The USS Constitution because of its white oak hull is a notable example. "Country built ships" laid down in Indian shipyards and Jamaican sloops fared well because they used woods that resisted marine life. However, most navies and merchants needed continual replacement ships each decade. Ship building was so important to national defense, that countries like England set aside entire forests to serve as raw material for shipyards.
Pirates who couldn't openly use careening wharves or careening beaches near unfriendly ports would often choose secluded coves with shallow approaches so deeper draft vessels could not attack them. This made numerous uninhabited islands in the Caribbean and Indian Oceans ideal careening stops.