Pirate Ships:
Every now and then you'll lock on to a Pirate ship.  'C'ommunicate with him, and notice the eye patch!  If you destroy him (not too difficult), two things happen:
a. If he's from a race foreign to the sector you're in, you'll get a thank you (and a bounty if you have a license).
b. His cargo will be left lying around for you to pick up. (Remember your training with the 'F' and 'O' keys?)
(Tip) By and large, this isn't worth the effort.
Pirate Bases:
Each race has a Pirate Base somewhere in their territory.  They're not on the map until you lock on to them.  They work just like a Trading Post; dock and buy/sell whatever you want.
This is where you get your engine and rudder "tuned"; i.e., performance improved.  It's expensive, so have money because you do need it.