Is insider trading illegal?
Not always. Insiders may buy and sell their own company's stock as long as they report it and don't trade on material non-public information. Trading on such information, or tipping off someone who does, is illegal.
Material non-public information is anything the public doesn't know yet that could reasonably move the stock price: earnings before they're announced, a pending deal, a failed trial, a lawsuit.
Legal insider trades are reported to the SEC on Form 4 within two business days, which is how sites like HedgeFollow can show them. Companies also set blackout periods, usually around earnings, when insiders can't trade at all.
Illegal insider trading brings SEC civil charges and can bring criminal prosecution, with fines and prison.
Related pages: Insider Trading Tracker