Summary:

Barbarian encampments may spring up in any neutral space which cannot be seen by a civilization's city or unit. If you want to keep barbarian encampments from popping up around your civilization, place units on hills to keep as much terrain in sight as possible.