Throughout the millennia the wall was built and refortified it took millions of people to complete this monumental task. During the Qin Dynasty that expanded the wall an estimated 300k soldiers and 1.8 million labors were used to complete the wall.
Criminals were forced into labor, they would work during the night and take turns patrolling the wall during the day. According to the laws of the time, they were required to serve four years of hard labor.
China utilized its military to instill order in the millions of laborers that were used to complete the wall. While this was a very immoral and dangerous method of completing a project, millions of Chinese soldiers, civilians, and criminals were able to complete one of the largest man made structures in the world.
The Great Wall of China stretches for over 13,000 miles. In the beginning the wall was erect using earth, rock, and even the bodies of those working on it. Later, when the Ming dynasty took power they refortified the wall after the 13th century mongol invasion. They reinforced the walls and added watch towers that alerted other watch towers via fire of invaders. They also added small holes at the top of the wall to allow archers to shoot through.
China was able to adapt and reinforce the wall throughout the century's to allow the wall to maintain it's effectiveness.
China as a nation was united in protecting their northern border from invaders.
This shared goal created a movement and motive, as a nation, to complete the wall.