Whether you must clear security again during a layover depends entirely on your itinerary's "sterile" status and the specific country’s border regulations. If you are on a domestic-to-domestic connection within the same terminal, you generally stay "airside" and do not need to clear security again. However, if your connection requires you to change terminals that are not connected by an airside shuttle, you will have to exit and re-enter. For international-to-domestic transfers (especially in the US), you are almost always required to clear immigration, collect your bags, clear customs, and then pass through TSA security for your next leg. In contrast, many European hubs like Amsterdam or Zurich allow international-to-international transit without re-clearing security, provided you arrive from a "trusted" country. If you choose to leave the airport during a long layover to visit the city, you will always have to clear security upon your return to the terminal.