Technically, there's a difference between pirate and privateer. The pirates are the ones acting without letters of marque, purely on their own authority and in their own interest, so they are not safe from being hung even in their home countries.
But there are gray areas, when governments want to have it both ways. Drake was endorsed, but only after the event. Raleigh had king James' backing before he invaded Spanish territory to find Eldorado, but he got disowned and executed when he failed.
But there are gray areas, when governments want to have it both ways. Drake was endorsed, but only after the event. Raleigh had king James' backing before he invaded Spanish territory to find Eldorado, but he got disowned and executed when he failed.