The pirates you often see as characters in stories or movies are, indeed, based off of real-life people in history who spent their lives as pirates at sea. Pirate is the term used for a robber who commits his or her crimes on the ocean by stealing from ships that carry goods or treasure.
The swashbuckling characters of fiction are usually based off pirates who roamed the seas in the 1600s and 1700s, a time when piracy was common. (Sometimes referred to as “The Golden Age of Piracy.”) It’s hard to know how much the pirates of history were like their modern-day portrayals. While some things were definitely true (such pirates being robbers at sea and even the occasional burying of treasure) others are mostly believed to be part of folklore (like parrot-pets and prisoners who must “walk the plank”).
Because pirate robberies were becoming such a problem, many governments of the time sent out ships to defend the seas and capture the pirates. Thanks to this, there are many fewer pirates today, and of those who do still exist, you will probably never have to worry about bumping into one! Today, the pirates of history are frequently found as interesting characters to hear about, watch, or pretend to be! Aaargh!