Here's a picture of what Jesus is talking about, followed by an explanation.
Sheepfolds, even to this day, offer a nighttime enclosure and protection for the flock. An opening in the wall allows the shepherd to herd his flock to their pen at day's end but often there's no gate to ensure that the sheep stay put and no harm intrudes. In fact, the shepherd sleeps right there and so, the shepherd is the gate...
So Jesus said again,
"Amen, I say to you,
I am the gate for the sheep.
All who came before me are thieves and robbers,
but the sheep did not listen to them.
I am the gate.
Whoever enters through me will be saved
and will come in and go out and find pasture..."