In Harry Potter each Hogwarts house has its own animal that represents it; is it ever explained how these animals came to represent a specific house? I never read a canon explanation to who chose the animals, is that known?
Since the four founders were involved in choosing students for their houses, it seems reasonable to assume that they also chose their house animal.
Reading the welcome letters on Pottermore offers one explanation: the animals were chosen because they had the traits that the founders valued in their students.
Slytherin and the snake. From the welcome letter:
We’re like our emblem, the snake: sleek, powerful, and frequently misunderstood.
It’s also well-known that Salazar Slytherin was a Parselmouth, and had an affinity with snakes. (I don’t know if Parseltongue had such a negative connotation when Hogwarts was founded; if so, I’m surprised he chose to advertise it.)
Gryffindor and the lion. From the welcome letter:
Our emblem is the lion, the bravest of all creatures
The lion is often depicted as the “king of the jungle/beasts” and as a symbol of bravery. If you look on heraldic crests, the lion is a popular choice for royalty, for similar reasons. It’s easy to see why Godric chose it.
Ravenclaw and the eagle. From the welcome letter:
Our emblem is the eagle, which soars where others cannot climb
This is a not-so-subtle reference to the fact that Ravenclaws believe themselves to be more intelligent than other students.
You could look at the answers to When is a raven like an eagle? When it's on the Ravenclaw house crest for a bit more discussion of the Ravenclaw house crest.
Hufflepuff and the badger. From the welcome letter:
Hufflepuffs are trustworthy and loyal. We don’t shoot our mouths off, but cross us at your peril; like our emblem, the badger, we will protect ourselves, our friends and our families against all-comers. […] Like badgers, we know exactly how to lie low – and how to defend ourselves.
I discussed Hufflepuff’s association with the badger more fully in another answer on the site.
Somebody who knows more about history than me might be able to comment on thehistorical significance of these symbols in medieval times (when these animals would have been chosen).
2 of the 4 are pretty obvious:
Salazar Slytherin was a Parselmouth, therefore very close to snakes, which immediatly leads to the snake as a symbol.
To be in Gryffindor one has to be brave beyond any other personal quality, what animal stands for courage? Exactly: The lion.
As far as the other to houses are concerned:
Or yet in wise old Ravenclaw
If you've a ready mind
Where those of wit and learning
Will always find their kind.
I think from wise to eagle is not that far a fetch, I also consider this to be pretty obvious.
The badger is known for having a gentle nature and has come to be the symbol of love and loyalty; both are traits of Hufflepuff house. It also is an ordinary animal if there is any, If there is a more specific reason out there I have not seen it yet
I've not seen Rowling give any explanation of her 'real world' choices, but had assumed they were based on medieval mystical or alchemical sources (such as Galen's humours and elements) similar to using the name of Nicolas Flamel. Of course it would be natural for each ancient family to have a coat of arms, so it's a bit of nice detail for the Harry Potter world. Rowling has said:
It is the tradition to have four houses, but in this case, I wanted them to correspond roughly to the four elements. So Gryffindor is fire, Ravenclaw is air, Hufflepuff is earth, and Slytherin is water
Fire is associated with yellow bile and choleric temperament, which in turn is shown in Minerva Britanna (1612) as wielding a sword and accompanied by a lion. Leo is also astrologically a Fire symbol. However, I believe fire is also associated with salamanders and snakes.
If Ravenclaw corresponds to air, that is associated with sanguineness and birds of all kinds. Hufflepuff is earth and so associated with burrowing creatures. Slytherin is water, phlegmatic and so could be a turtle, salmon or frog (or astrologically scorpion), but perhaps for narrative reasons is here a threatening serpent.
It's occurred to me that the symbols may share a common origin with RA Lafferty's 1969 novel Fourth Mansions, which refers to C16 Teresa [Cepeda] of Avila's Interior Castle.
Fourth Mansions fantasises about four secret influences latent in humanity, monsters blocking the way to the castle, represented by a badger, a falcon, a python and a toad. These obviously don't match up completely: badgers are the faithful defenders, 'stubborn holers into the earth'; the soaring falcons are the far-sighted authority; the python symbolises 'illicit wisdom' and prophecy, but 'unaccountably, the Lion symbol is alternate to the Python' so they might be closest paradoxically to the Gryffindors; toads resurrect themselves and prevent progress in a similar way to Voldemort and perhaps Slytherin.
This is speculation on my part as I don't think these are in Interior Castle itself, but Rowling might have been influenced by related Christian or esoteric literature.
Edit: I also see the claim Rowling was consciously referring to a 'Battle Chess' computer game (maybe, but I'm dubious), and this essay explores symbolism of each mascot.
While this may not be what J. K. Rowling intended originally, this is what the badger symbolizes and its character traits. Note that she originally considered the bear as the symbol so these traits would connect. What was Helga Hufflepuff’s animal ‘avatar’?
The badger symbolism shows how the badger is actually regarded and also how Hufflepuff can bring out the best traits in a student. Even the mountain lion will hesitate to take on a badger and it shows that "size" can be irrelevant in defending what is yours.
The badger stops at nothing to get what it wants, and this is a lesson for us to be persistent in our pursuits. Specifically, those with the badger totem often attract this creature because he/she has difficulty finishing what is started. The badger will help with this aspect in life. You can call upon the stubborn, strong-willed nature of the badger to help you complete any project you start.
The badger is also fiercly independent and can be quite aggressive when threatened. This is a lesson for us to stand our ground and make our presence known when the situation calls for it. Although smaller in stature, the badger commands attention from friend and foe alike.
The white stripe is symbolic of how open it is, providing knowledge and enlightenment to other animals and the earth.
The strong jaws tie the badger to the mysteries of the “word” – in particular the magic of storytelling. Badger reminds us to remember stories and give them away to people when they are needed.
The remarkable digger hints at the ability to see beneath the surface of all things and people. Also, the closeness to herbs and roots make badger dynamic healers.
Loners and solitary, badgers teach us to be self-reliant and comfortable with ourselves.
Bold and ferocious when cornered, badger reminds us to never surrender.
The badger imparts persistence, determination and endurance. Badger also gives mental energy and fighting spirit. It would rather die than give up, so badger teaches us how to stick to a project and see it through to completion.