A gate is a place between two parts of a wall, or a fence which could be opened and closed to let people go through it.
In the Middle Ages, a city gate also allowed people to go into a (walled) city.