This country has in place a whole array of laws so that we can set guidelines to appropriate behavior while at the same time protecting the rights and freedoms of the populace. All societies have laws that must be obeyed and when you break one of these laws and get caught, there are consequences. If you steal from someone (which is against the law) you are breaking the law...anytime you break a law, you are doing something illegal. There are laws at all levels of government from the city to the federal level. There are also government regulations and policies that provide oversight of all kinds of activities, such as how taxpayers are expected to behave. For example, if you do not pay your taxes or attempt to circumvent tax rules to not pay as much as you should, you are breaking the law, and this is illegal. Get the picture?
Now, as to illegal immigrants...the same applies. This country has a myriad of laws or regulations relative to immigration. There is a large part of the federal government that is empowered to implement our immigration laws. For example, anyone can come into the USA for a visit or business, etc. as long as they have a valid passport and follow the other rules associated with coming into the US. For example, there are timelines, visas, etc..and other factors to consider. If you attempt to come into this country without following these rules and regulations, you are coming into the US illegally and therefore are considered an "illegal alien" or "illegal" and can be arrested and deported, amongst other things.
One of the problems this country has relative to immigration are the broad borders with Canada and Mexico where it is relatively easy to cross over without being detected into the US. California, New Mexico, and Texas have a huge illegal immigration problem relative to Mexicans who have chosen to circumvent the normal immigration policies which are time consuming and complicated to get through...for a reason..which is to attempt to control who is allowed into this country and how many. As a result, California, for example at any one time, has millions of illegal Mexicans in the state taking advantage of the American taxpayer provided welfare and healthcare.
So, if you are in this country without a green card, or visa, and without a valid passport..you are probably one of those individuals we would call an "illegal".