The rules are different in every country and every airport, but in general, you will not go through an immigration check when flying domestically within a single country. You will generally go through an immigration check when flying internationally in to a country, with some exceptions, namely when flying between countries that are part of the Schengen Area in Europe (e.g. a flight from France to Germany is treated as a "domestic" flight even though they are two different countries, but a flight from the United States to France is still an international flight, and you will be interviewed by an immigration officer).
Note however that territories, exclaves, islands, etc... may be considered part of a country, but still separate from the immigration and/or customs territory of that country. Travel to/from these areas may be subject to special immigration rules and you may be subject to an immigration interview. The exact details depend on the territory and country concerned and should be the subject of a separate specific question.
However, you may be required to show ID at some point in the process, and in some cases there may be specific immigration checks, either a permanent set of systematic checks or through random controls. Passengers may be pulled aside for further checks at this point, and those staying within the country illegally could be caught. The risk of this depends greatly on the country involved and your circumstances.