How exactly do these laws work if the servers are hosted outside of the US?
They don't, of course. These laws aren't here to protect children. They're just a step on the road to one of their (conservative Christian) goals: banning pornography entirely in the US.