Illegal means something forbidden by law; a defined criminal act. Unlawful means something that is not authorized by law, but which may not be expressly defined as a criminal act.
For example, it is not illegal in my state to carry a pistol, but it is unlawful to carry one without a permit.