Captain William Kidd was a Scottish privateer-turned pirate, and the centre of numerous pirate legends.
Not much is known about Kidd before the late 17th century - even his year of birth is approximate. It's reasonably certain he's from Scotland, but that's about it. (Every good pirate needs a mysterious past). Kidd first appears in historical records in 1689, when he's listed as captain. He was a privateer for Britain in the West Indies, before sailing for New York City where he lived for several years.
In 1695, Kidd was given a privateer's commission to hunt ships in the Indian Ocean, and headed for Madagascar - which at the time was a known pirate haven. Then Kidd disobeyed the terms of his privateer's commission, attacking ships in the Red Sea - no one is quite sure why, but I guess that's pirates for you. They're bonkers.
When Kidd returned to the West Indies in 1699, he found that he was a hunted man. He sold his ship - the Quedah Merchant - in Hispaniola, and headed up the coast in a new ship. Kidd knew he was likely to be caught, and wanted to have bargaining chips to secure his own freedom, so he started hiding treasure as he went. The idea being that he could give away the locations in order to save his own skin.
Kidd was finally captured when he returned home to New York. He tried to talk (and buy) his way out of arrest, but it didn't work. He was hanged for piracy in 1701, which must have been so annoying.
As for Kidd's treasure, it's known that he buried some of it on Gardiners Island, off the coast of Long Island, New York - That part was eventually recovered after Kidd's death. Nobody knows what else he hid, but speculation still rages today over how much he buried, and where.