undertale does addresses this point though, which is why magic is a thing. We see in the original game about the monster's dreams of going to the surface, and how they build their civilization around it
Horrortale is about how it would happen if magic didn't exist but at that point it's not the same universe anymore, they become just like every other evil fantasy race.