Some notes on the UK:
International and domestic passengers may share a departures area. However, as there is no ID requirement for domestic flights, domestic passengers will have a digital photo taken before security, which is linked to the barcode on their boarding pass. This is then checked at the gate during boarding. This prevents illegal immigration by somebody in international-to-international transit swapping boarding passes with a domestic passenger in the departures zone.
International-to-international transfers are allowed without entering the country. However, some nationalities need to have a transit visa to be allowed to do this.
International-to-Domestic transfers are allowed without clearing customs at the transit airport, in most cases. Luggage, in this case, may arrive at a special carousel for international transit passengers, or be flagged for a customs officer to inspect on arrival.
International arrivals are always segregated from departures - you need to re-clear security before being considered sterile. This was implemented post-9/11, and has resulted in some awkward arrangements in some older terminals (e.g. Heathrow 1 and 2) which were not set up with this in mind. At its worst, in Heathrow T2, the main pier corridor had to be partitioned, and departing passengers held back while arriving passengers cross over, all manually controlled by security staff. This could also mean delays on arrival, if there were too many departing passengers to hold back!
All departure ramps/gates are closed off, and opened by a card swipe & PIN at boarding time. There are, however, two types of boarding card inspection: one on entry to the gate area, one on boarding. The former can cause problems in case of last-minute delays, as passengers needing to leave the gate area (for toilets, shops, baby feeds, etc) no longer have their boarding passes, only the stubs (it's customary for a passenger to keep only the stub). In the past, this could further be compounded by pier entrances that were one-way due to mixing departing and arriving passengers (no longer possible).
A further quirk on boarding is that UK-registered airlines need to check passengers' boarding pass stubs at the entrance to the aircraft, to confirm they have reached the correct flight.