Generally, your domestic flight discharges into the domestic sterile area, and you can hop right on any other domestic flight on any airline. Airlines' domestic terminals are usually interconnected.
Not all airports have their domestic terminals interconnected (typically due to facility constraints, e.g. Detroit). Last time I was at Long Beach, there were two "terminals" in temporary buildings each with their own TSA security line. JetBlue dominates the airport, so even JetBlue thru-passengers had to re-clear.
As choster observes, airports with smaller international trade probably won't have a separate international terminal, their international gates are commingled with domestic gates, and domestic to international transfers aren't so bad. (the trouble with the reverse is the need to clear customs; customs areas are usually set up to dump you into non-sterile areas.)
Some airports with dedicated international terminals, have the desired connection or shuttle bus between domestic and international areas, so you don't have to re-clear. Even if it has one, it may not work for you. Take SFO: it's a hot mess. The new international terminal is stacked practically on top of the domestic terminals - a sterile-area connector is easy. But they hadn't built the connectors by 9/11 and paused after that. They finally opened one side in 2009, which serves only from domestic terminal 3 to international G, not reverse due to Customs exiting into the public area. And domestic 3 doesn't connect to 1 and 2, and international G and A wings don't connect. So it's weak tea that only works for one airline. ORD has similar issues. LAX is now better for some transfers.
Unlike at SFO, the separation is often a simple facility constraint - series of expansions often end with terminals some distance apart. It's not like airport managers are twirling their moustache going "How can we force passengers through security twice, hahahaha!"
And that's what you're up against at JFK. The poor international-terminal connections are part of the greater problem of poor sterile connections generally amongst the many terminals. That is one reason many advise to avoid transferring at JFK.
It's just an unfortunate side effect of multiple expansions at the busiest airports, from which so many international flights operate.