A gate is a moveable barrier that closes or opens a gap in a wall or fence. A garden gate might swing on rusty hinges, when closed helping to keep deer away from your vegetables.
A pasture gate keeps cattle or horses safe inside a fence, and if you visit someone who lives in a gated community, you'll have to be buzzed in before the gate opens to allow you inside. You'll also find gates at the airport — they're the areas with doors leading out to the airplane. The Old English source of gate is geat, "gate, door, opening, or passage."