We can use this word in several different ways today. You might talk of a flock of sheep or a flock of birds, but it can also mean “congregation of Christians”, in a transferred sense from the sheep. There are also expressions, such as “birds of a feather flock together”.
We take the word from Middle English, where it can be found as floc, flokk, flok and even flock.
It was not used only for birds or sheep, but for groups of other animals too. Take a look at this example from 1225, from the Homilies in Cambridge (Trinity College).
…þat he hem sende into floc of swin.
(that he send him into a flock (drove) of swine).
Going back a little further to Old English, the word has not changed. It appears as flocc or floc. But it was not for the exclusive use of animals, but rather meant “group, company” in a more general sense, and was used to refer to crowds of people too. Consider this reference from the Saxon Chronicles, from the ninth century:
Him mon mid óðrum floccum sóhte
(they were sought after by other companies).
Cognates for the word exist in other Germanic languages, such as Swedish flock and Danish flok, meaning “band, flock or pack”. There are two schools of thought as to where it ultimately comes from. Some believe that it is related to folc (folk), meaning “people”, but it was unusual for Old English to present metathesis (the vowel and consonant changing places). Others postulate a separate Proto Germanic root *flukka, *flokka, meaning “crowd, troop”. It may have been unusual, but it was not impossible for there to have been metathesis of folc to flocc, yet this does not explain how the same metathesis occurred in other languages, unless it actually occurred earlier, during the Proto-Germanic stage. In either scenario, there is a tendency to link folc and flocc, but the uncertainty remains.