In the US (and some other airports internationally, but not everywhere), when you arrive on a domestic flight, the path out of the plane is exactly the same as the path in, and you just get into the departures area, and you can move on to the next flight directly.
When you arrive on an international flight, you are routed differently: you have no direct access to the departures area (they will close the access to it), but to a special path that leads directly to passport control. This usually means getting to an upper or lower level (or both) and often involves quite a walk.
Specifically, in JFK T4, departures are on level 3, but the jetways to the planes are on level 2. When you depart, you go down from level 3 to reach the jetway on level 2. When you arrive on an international flight, you remain on level 2 (which is isolated from level 3, and actually from anything else), and at the end of the corridor you go down the ramp to passport control which is on level 1.
Once you get to passport control, you have the following steps (if you are checked through to the final destination):
- Queue and go through passport control
- Reclaim your bags
- Go through customs
- You are now out of the secure area
- Just after customs, just drop the bags at the counter designed for this (the bags will show the final destination on the tags, so there's very little waiting, basically just drop the bag on the conveyor belt).
- Go to departures (usually involves going up one floor)
- Go through security
- You're now back in the secure area
- Go to your gate
There are a few cases where some of the steps are omitted and you don't actually see your bags and/or have a shortcut to departures, but I don't think JFK does this.
If the two flights are booked separately (self-transfer), it's more complex, as you can't just drop the bag at the counter after customs, you need to go to check-in/baggage drop to do that (and you have a much tighter deadline and a much higher risk).
The possible exception is if you arrive from a Pre-Clearance airport, like Dublin: in that case you will have gone through passport control and customs before departure in Dublin, and your flight is considered as domestic.