Jesus' heart was moved with pity for the vast crowd, for they were like sheep without a shepherd. A shepherd plays a central role in the life of a herd or flock. While mostly seen to be wielding a "supervisory" role, the shepherd is a very essential part of any herd. A shepherd assumes the life of the herd. He/she becomes one with the herd. He/she must know each and every sheep in the herd, even to the extent of giving them names at times. The shepherd's role is that of looking after and taking care of the herd. The shepherd must know where the green pastures are as well as how to get there. The shepherd is always on the lookout for wolves and other predatory animals, and is always ready to put his/her life on the line for the herd.
Jesus was not the first one to use the shepherd-herd imagery. The Hebrew Scripture already identifies God as a shepherd (cf. Isaiah 40:11; Jer 31:10; Ez 34:31; Ps 23; 80:1, 95:7, 100:3). God assumes the role of a shepherd, with the understanding that God's role is to gather and tend the flock. However, the shepherding role is not only God's: the leaders of the people are as well drafted into this responsibility by God (cf. Numbers 27:17; 2 Sam 5:2; Jeremiah 23:2). As shepherds, the responsibility of the leaders was to gather the flock together and feed them, lead them to greener pasture, and keep them from straying/harm. And so when Jesus compares the people to a shepherd-less herd, he points to the failure of the leaders to perform their duty. The people have been starved of the word of God and have been left prey to marauding predators. The people have no one to direct them and give them hope and encouragement. The religious leaders as shepherds appointed by God have separated themselves from the herd and neglected their duty. As such, they have no way of feeling what the herd feels. They have no way of knowing what ails the herd.
When Jesus declares that he is the good shepherd (cf. John 10:1-18), therefore, he does so because he has assumed the life of the herd and has come to know the sheep. The crowds mill about Jesus because Jesus feeds them with the words of life. Jesus is able to heal those who are sick and possessed because he has shared their lot and understands their predicament. He is able to feed those who are hungry and cloth those who are naked because he has experienced their plight. As one of them, Jesus knows what it means to be hungry, cold, and naked. Jesus was able to pity them because he knew them by name. They were his very own.