A stockade is an enclosed pen used to herd cattle and other livestock. Stockades can also house men, in the sense of a penal camp. In both cases, the treatment tends to be on the rough side.
Stockades are also built as a means of protection or defense. Fun fact: Did you know that one of the most famous stockades in America was the original Wall Street in New Amsterdam — that is, the protective wall of wooden stakes dug into the ground that marked the northernmost part of the Dutch settlement from Injun' territory? Or at least it did until the Dutch, in need of firewood, chopped it down.