Long before the eventual tranquilization of Discord, the three types of ponies (horses): earth, pegasus, and unicorn (little bit of a power imbalance but whatever), lived in hate and disharmony.

Then six horses, an ambassador and assistant of each type, got caught in a blizzard. The ambassadors discovered the power of hate, while the assistants discovered that talking exists.

They talked for a while, somehow not starving to death. Then the ambassadors stopped using the power of hate. Then Equestria.

Eventually the unicorns secretly discovered that they were superior in every way, and this guy named Star Swirl (he had a pretty epic beard) decided to beat up this demon guy. Then he decided that ruling is lame and wrote a letter to Alicorona. The letter was delivered by a blind Pegasus, so it ended up with two alicorn children living in the woods, who decided to take up the beard dude's offer.

Satisfied, Star Swirl left Equestria to these two sisters who didn't understand things like mortality, familial bonding, or sleep.