It might sound obvious to say that pirates were largely motivated by the possible financial gain attached to their profession. Pirates could find a huge amount of really interesting loot when they successfully attacked and captured merchant vessels. Things like gold, silver, sugar and spices could all be found as part of the pirate treasure hoard. There might even be rare substances like quinine and indigo on board if they had found a particularly wealthy merchant ship to target.
The type of ship attacked, and the area in which it was targeted, had a lot to do with what pirates could get from the ship that they attacked. This was why the Spanish Main was such a popular area for pirates to frequent; the Spanish treasure fleet made yearly trips between Portobello and Peru that left it carrying around 25 million pesos worth of Gold and Silver. To put that into perspective; that was roughly twice the annual income of the British Monarchy at this point. So, as you can see, there were rich rewards in the sea for those willing to take the risk. This was the job of the Captain; assessing the risk and make the most pirate treasure as possible.
If a captain chose the wrong ship, or attacked at the wrong time the results could be utterly disastrous; capture by the Navy, death, and serious injury were a real threat and the only thing worse was facing this only to come away empty handed, no pirate treasure for their efforts. Being too cautious, however, was as likely to end badly as being reckless. Ships were known to get rid of Captains who were faint of heart. If they were successful, however, the pirate treasure was to be split equally among the entire crew. It was easy enough to split goods like sugar, spices, cloth and food good, but slightly harder to split gold and silver coins or jewels. There is some evidence that coins were cut into smaller pieces with their knives.
What a pirate did with his hard earned loot after getting it handed to him has long been the subject of myths and legends. Some say that pirates buried their treasure, but there are only one or two actual examples of this happening. Captain Kidd is the most notable example of this behaviour. The truth of the matter, however, is that most pirates lived a hand-to-mouth existence due to their spending habits. Most of their money went pretty much immediately on wine, women and music. The effort, time and restraint required to actually bury their fortune was just beyond most pirates.