But big airports like LAX have a “sterile” international area where passengers in transit can go to their departing flights without entering the USA.
This is standard operating procedure all over the world - in London, Paris, Amsterdam, Frankfurt, Rome, the Gulf - everybody has an international transit area.
Except Dublin. When my daughter was flying Hamburg-Dublin-Bordeaux, returning from vacation to her job in France, she had to enter Ireland to get her flight to Bordeaux. I had given her a Streamlight flashlight with a rail attachment (but no rifle) for her stay in France, she brought it with her to Germany, but the Border Force in Ireland detained her because rail mounts are not permitted and they wanted to know where the rifle was.
they might have a “sterile”area for transit passengers, but then why did my granddaughter who was scehduled on a Manila to Vancouver flight get told she was not allowed on her flight to Canada that had a layover at LAX? She had to rebook (costing money and time since we live four hours from the airport).
She is not a US citizen, but we have since gotten her a long term visitor visa so she can enter the US for short visits so this won’t happen again.