Napster is technically different from piratebay (lets just call it a bit-torrent site, as pirate bay is just one of many). Firstly bit-torrents are a method of transferring files similar to a file sharing network but the important thing here is don't assume all bit-torrents are illegal.
However, because bit-torrents are a really good way to share files, it came to pass that a lot of illicit material is available via bit-torrents.
The law is a bit shady but in a nutshell, it's illegal to copy licensed 'items' (be it films, audio software etc) without either owning the original or getting express permission to do so. It's illegal to sell it but the possession laws are practically un-enforceable.
Now the shady bit lets say you downloaded a Sony PS2 game and burned it on a blank CD, then printed a Sony label on it with game title etc. if caught, which is highly unlikely unless you sold it, You would get charged for copying the label rather than the contents of the disc, simply because they can enforce a higher sentence (fine usually) for the label!
Now the torrent sites only list torrents they don't actually posses the data (it's on other peoples machines) so they aren't technically breaking the law despite the high powered business's that hit them with unwarrantable injunctions every week.
Bit-torrents are here to stay and a lot of country's don't even have any software / copyright laws so are free to host what ever the hell they like.