This is an extended metaphor. The leaders of the church are supposed to care for the people under them and protect them from enemies just as a shepherd would care for his flock of sheep and protect them from wolves. (See: [[rc://en/ta/man/translate/figs-metaphor]])