variant of 群[qun2]
Phonosemantic compound. 羊 represents the meaning and 君 represents the sound.
《說文》:“羣,輩也。从羊,君聲。”