Barbarians can come from their cities, but they can also be generated in any square in the "fog" (the black area where you've never been, and also the area where you can't see what's going on because you have no unit or city cultural boundry that can see it).
Yes, they are infinite, but eventually when civ's cultural boundries and line of sights expand they will not generate anymore because there is no place to do so. Also their tech levels off so eventually they'll be macemen trying to fight your infantry.
One thing you can do in the meantime is station units outside your cities so they can see the surrounding areas. Barbarians won't generate in the zones your units can see, and hopefully if they do generate outside those areas they'll come attack your dudes fortified on the hills instead of raiding your cities.
Look at them as an opportunity. Have units strong enough to defeat them, and let them gain experience wailing on the barbarians before they go to war against other civs.