How was the Great Wall of China defended?

How was the Great Wall of China defended?