The clue is in the word “illegal”, David. There are a very wide range of criminal offences covering all types of, er, illegal behaviour. Not just in immigration law, either! In an immigration context, though, section 24 of the Immigration Act 1971 (“title: Illegal entry and similar offences”) is probably the main one. It makes it a criminal offence to enter the UK illegally or knowingly to overstay.
Says a lot about the quality of our Members of Parliament and the level of “debate” around the issue of immigration.