Here we should distinguish between the language as it is generally spoken and understood, and the technical language of lawyers and politicians.
For most people the words mean the same.
There are technical differences: In 2019 the British Prime Minister asked the Queen to temporarily suspend (to prorogue) Parliament. The courts declared this "Unlawful" meaning that the Prime Minister hadn't followed the law, so the suspension had never happened. The courts didn't say it was "Illegal" (so the police didn't arrest Boris Johnson.
If you make a contract that is unlawful, then you can't enforce the terms of that contract. But that doesn't mean that you have broken the criminal law. In general if you do something illegal then you would expect the police to arrest you. But if you do something unlawful, then you won't be arrested, but you can't then depend on the law to help you out and you can expect the courts to tell you to fix the unlawful thing that you did. Refusing to fix it would then be illegal.