A wall of sharpened stakes gives some security, stops livestock from straying and may delay a thief, but cannot hold out real attackers for very long. It is, however, cheap to build and doesn't require any special skills from the local peasants.