A flock of chickens is scratching around peacefully in a farmyard. As the birds cluck away to themselves, a fox stealthily creeps up on them. Fortunately a rooster sees the interloper and calls loudly; all the chickens run for shelter. The commotion attracts the farmer and the fox quietly slinks away.
If a hawk then flies over the farmyard, a member of the flock again gives the alarm - but a different alarm from the on provoked by the fox. The alarm given for the hawk is a 'raaay!' noise, alerting the flock to danger in the air. It is quite different from the 'danger on the ground' alarm, which is a 'gogogogogock!'. By having different alarms, the chickens can communicate not only the presence of a threat, but also give some idea of its direction of approach.
Chickens have an entirely different means of communication for maintaining the social structure of their flock. We use the phrase 'pecking-order' to describe a hierarchy in human society. The term comes originally from observations of the behaviour of chickens. In a flock there is a well-defined social order, which determines, among other things, which chickens get to eat first. There is a dominant bird that has first go at the food. Secondary birds are subordinate to the top bird, but dominate the rest, and so on down the flock.