Insider trading is the buying or selling of a security by someone who has access to material nonpublic information about the security. Insider trading can be illegal or legal depending on when the insider makes the trade. It is illegal when the material information is still nonpublic.
Insider trading is defined as a malpractice wherein trade of a company's securities is undertaken by people who by virtue of their work have access to the otherwise non public information which can be crucial for making investment decisions.