Basically, Rumpelstiltskin spun straw into gold for Lillian’s mother (Queen Ivoire (like in the original fairy-tale)) and after that she married King Constantine and became his Queen. However, when Rumpel came to collect their first-born (Princess Lillian), King Constantine saw him and banished him to the Crone’s Nest.
However, the ogres were horrified when they found out how much of a jerk Rumpel really was, so they turned on him. They weren’t able to overthrow him completely, so they fled into the woods and, under Fiona’s leadership, formed the resistance.
This theory would help explain quite a few unanswered questions people have about this film and its relationship to the others.
For instance, it explains why there seem to be a lot more ogres in the alternate timeline than the original one. Ogres probably have their own homeland somewhere far from both FFA and Duloc, maybe it’s the fantasy version of the Everglades (a gigantic swamp). Shrek left there when he was young (perhaps after his father tried to eat him) and moved to the smaller swamp where he is now. The other ogres didn’t, so in the original timeline, they still live there (and we never see them in the other films since it’s a remote area).
In the alternate timeline, Rumpel (or someone working for him) specifically traveled to the ogre homeland to recruit them; maybe he offered them all-you-can-eat weedrats or something.
It also explains why the resistance ogres don’t really behave like typical ogres; they’re not as antisocial or cynical as you’d expect them to be, and they’re able to work together in large numbers. The experience of moving to FFA, working for and then turning on Rumple, and being led by Fiona has changed them a lot.
This is all kind of bittersweet, since it all got undone in the end. Shrek gained a lot of character development when the original timeline was restored, but the other ogres lost theirs, and went back to their old, brutish selves.
Perhaps Rumpel was self-conscious about his appearance, due to being a “curly-toed weirdo” and all. Prior to the events of Shrek the Third, he made a deal with some guy who agreed to trade faces with him, in exchange for something else (like money, perhaps).
When we see him in the third movie, he has the other guy’s face, and maybe some of his personality as well (which explains his seeming willingness to reform at the end). But the other man who now had Rumpel’s face was disappointed that no one recognized him anymore (it didn’t help that he had also become uglier), and decided the deal wasn’t worth it. Between the third and fourth films, he managed to invoke the escape clause and got his old face back. Cheated out of his chance at good looks, Rumpel was embittered and became evil again.