If you are interested in pirate history, I would highly recommend reading Captain Charles Johnson's A General History of Pirates. It is a classic for those interested in pirate lore. It was first published in the early 18th century and contains a detailed account of the most famous pirates, such as Blackbeard and Captain Kidd. It combines facts with legends, giving you an insight into how these pirate stories have changed over time. I came across it on this great list of books about pirates:
https://booksrun.com/blog/the-best-pirate-books-you-should-read/. If you want to understand the roots of pirate mythology and the actual events that inspired countless pirate stories, I highly recommend reading A General History of Pirates.