I've only been playing a couple hundred hours, but I've done two of those missions. The first, I found the pirate and they were already under attack from NPCs. Pirate was almost destroyed and I managed to fire the last shot and got the credit. That was an hour or so after taking the mission. In the second case, I was faster, and found that the pirate had a couple of NPCs circling around. When I started attacking, the NPCs jumped in and started attacking the pirate. Again, I got the last shot and the credit. I may be wrong about this, but it seems like the BGS is going after them, too. Is that possible? Doesn't seem likely, I admit.
It's just the way those missions go. You drop into a USS where your pirate target is in the process of 'pirating' a trade ship and it's escorts, so those ships will generally weigh in and attack the pirate in self defense. Not always, occasionally they decide to leave you to it.
@OP. If these were standard pirate lord assassinations where you are told to go to system X and find your target (so not, as Morbad describes scan a data point to find your targets whereabouts), then the reason they all failed is that there is a window of opportunity given in the mission description, and while you can actually find your target before the window of opportunity, if you haven't found and destroyed them by the time it ends the mission fails.
Assassination missions also have a 24 hour timer, but unfortunately that is a redundant bit of text and plays no part in the mission at all.
To summarize:
1. Accept mission to kill target who will be in system X between two times (usually a little while in the future).
2. Fly to the target system and get the location of your target by scanning the nav beacon or honking an advanced discovery scanner. This will reveal a body in the system where you will find your target. Fly to that body, get close (typically within the million meter range rather than the light second range) and even if you are before the window of opportunity the target will spawn in a mission USS.
3. If you are within the window of opportunity, then the target should also spawn in supercruise and you can interdict them if you wish. Pirate lords will often save you the trouble and will interdict you.

Otherwise the steps in 2 still work.
4. You must have finished the mission by the end of the window of opportunity otherwise it will fail.