Let's start off with a list of all the sapient civilizations.
We've got the two round-eared, mortal civs; dwarves and humans.
We've got the two pointy-eared, immortal civs; elves and goblins.
We've got kobolds, the skulking civ, who defy easy classification - they have no language, they're hairless. Most reminiscent of goblins, with their glowing eyes and carnivorous diet.
We've also recently got the subterranean *-men; Amphibian Men, Antmen, Batmen, Cave Fish Men, Cave Swallow Men, Olmmen, Reptilemen Serpentmen... IIRC they speak goblin.
Expanding on that last one, we have some critters that are probably sapient but just have no civilization yet, like *-men in earlier versions; tigermen, merfolk, pixies and so on and so forth.
Finally, we have whatever prehistoric civ carved the Mysterious Constructions. We don't know much about them.
Now, dwarves and humans are pretty straightforward. They don't really mess around with magical beings except for gods (and things pretending to be gods).
They might have a common evolutionary ancestor. They might share this ancestor with elves and goblins, but they definitely split off on their own branch at some point (maybe gnomes are related, too).
Goblins and elves, too, are very alike.
They're both pointy-eared, slim, and immortal. And they've both got supernatural backing, goblins in the form of their demon leaders, elves in the form of their close bond to the nature sphere.
I assume the elves have struck a mutual pact of alliance with all natural things - this is why they don't get attacked by animals, and why their ethics forbid the killing of animals or plants (presumably, they live off of berries n' fruits and animals dead from natural causes, like attacking an elf). Maybe they were one species until goblins sided with demons and elves sided with topside? Maybe this proto-species built the Curious Structures (or at least the seals) after digging too deep? In any case, modern elves obviously don't remember all this, only to not trust stuff from underground. Goblin demon leaders
probably remember, but they have no interest in freeing the competition.
Now, skipping kobolds for a moment, the *-men.
Like most stuff underground, the animalmen are demonspawn. (this is also why stuff like giant olms or toads happily attack elven explorers despite their bond with nature)
Animals twisted into humanoid shape are some of the more popular demon shapes; animalmen is what happens when they breed or procreate. (with who, you ask? Humans or goblins, probably)
On a similar note, the forgotten beasts are probably just extremely powerful demons that escaped back when whoever made the Curious Structures first breached Hell.
Maybe titans of the various spheres are divinely-made counterparts?
As for kobolds, who knows? They have traits of both goblins(glowing eyes, bonecarns) and elves(bond with insects).
They are also either incapable of speech, or have transcended their need of it. Maybe they're the common ancestor, driven into hiding by the stuff they unleashed upon the surface world (possibly divine punishment - tower of babel, except worse)? They're about the right size for using shortswords...