Possible meanings are 1) "them" refers to the three shepherds or 2) "them" refers to the sheep owners.