It's illegal because there's a law against it; IP is not a legal term, it's a term for constructing laws, and persuading people they're good laws. It's easy to lump all IP issues together, as indeed many people on both sides do; it's not really very helpful, though, when current law is very different for patents, copyrights, trademarks, and trade secrets.