Jesus saw the crowd and felt that they were like sheep without a shepherd. So he began to teach them, to give them guidance, for he was the Good Shepherd. The background to Psalm 23, "The Lord is my shepherd" may be seen in chapter 34 of the book of the Prophet Ezekiel: God had grown impatient, even disgusted, with the way in which the kings of Israel failed to take care of the people, the sheep of God's flock who had been entrusted to their care: the people were truly like sheep without a shepherd.
God never wanted Israel to have an earthly king but when Israel insisted, God let them have their way until he was forced, out of mercy and love, to take back to himself the duties of the king, the duties of a true and good Shepherd. When Jesus proclaimed himself as the Good Shepherd that was one of the occasions when he came close to an open and unequivocal affirmation that he was God.
Most of us are urban dwellers and have no experience of what it means to be a shepherd - we have not seen shepherds at work and know little of their reality. We have, however, learned to accept the image of the Good Shepherd and we understand to some degree the need for God's guidance and for Jesus' teaching to ensure that we are guided along the right path in life, the path that will bring us safely to our heavenly home.
Lord Jesus, guide us through life to our heavenly home.