The Great Wall of China and the Berlin Wall have an obvious similarity, in that they were both built to separate people from each other. Both walls were also of significant size, although The a Great Wall of China was substantially bigger. The two walls did have some key differences though.
The Great Wall of China was built to protect the Chinese from Mongolians and other invaders, meaning it was mostly for military strategy. The Great Wall of China spanned a little over 5,000 miles, which is astronomically larger than the Berlin Wall, and was built over the course of several decades.
The Berlin Wall was built because of political tension between the United States and the Soviet Union after World War II. The city was divided into two halves, the United States controlling the West and the Soviet Union controlling the East. Many people from the East fled the communist ruled East and, in response, the Soviet Union constructed a wall overnight to separate the two sides. This wall had no military value, and separated civilians from each other. This wall was also torn down after the fall of the Soviet Union, only around 30 years later.