The English idiomatic phrase “hay is for horses” is a specific idiom with a particular meaning and use; at its core, the phrase is really a remonstration for someone using the word “hey” as a verbal opener, to address someone or start a sentence. The idiom uses a pun on the words “hey” and “hay,” which are “homophones” or words that sound alike. If someone says “hey,” someone else might answer “hay is for horses.”
The implicit second part of this phrase is that since hay is for horses, it is not for people. This kind of idiom was popular in older times when more formal uses of English prevailed in many English-speaking societies. These days, it has become less common to address someone’s use of the word “hey,” although this still may not be appropriate in a more formal setting. Although people might not use this phrase that much anymore, it remains a primary example of an idiom that has a more focused purpose and use. Many idioms are just describing situations, but this phrase is actually a somewhat veiled imperative that many might call “passive aggressive,” because it avoids actually telling someone not to say the word “hey,” but instead, suggests the change in a roundabout way.
As part of a larger rhyme scheme, this phrase is most commonly used to communicate to children. Some people remember this phrase from their childhoods, where the actual whole saying is somewhat longer. For example, some English speakers have traditionally told children “hay is for horses, cows eat it too, if you don’t be quiet, I’ll feed some to you.” This longer form of the veiled imperative contains a more direct yet vague verbal threat, but it still doesn’t identify exactly what the speaker means to say, which is to prohibit someone from using the word “hey.”
This phrase falls into the larger category of animal-related metaphors. While many other idioms have synonyms, this one does not. It is a specific kind of colloquial language construction that represents a sort of “nursery rhyme” approach to establishing parts of the English lexicon. Linguists often study these sorts of phrases to observe the ways that culture informs language over time.