After the second world war, Germany was annexed into four zones. Berlin was annexed in a similar way. Since Berlin was geographically located within the Soviet annex of Germany, the Allied zones of Berlin were essentially surrounded by the Soviet East Germany.
This left an escape for any East Germans wishing to escape the Communist regime. They simply traveled to West Berlin and from there could live life in the West.
It is estimated that some 3.5 million East Germans had migrated to West Berlin by 1961. This was a whopping 20% of the population of East Germany at the time.
The Berlin Wall was the East’s answer to this curious escape route.