It refers to the act of:
* Guiding and caring for a flock of sheep
* Leading and protecting a group of people
The word "shepherd" can also be used as a verb, meaning "to tend to" or "to guide".
For example, "The pastor is shepherding his flock through a difficult time."