She was sad the muffin was gone wanted another, so she went back in time, ate the muffin but made her past self sad. So she kept taking her past self to eat the muffin and the same reult. And it kept repeating itself until you see the many derpies there.
It'd be sadistically hilarious if every time Derpy finds a muffin, she finds her future self already eating it. And no time loops. Derpy will never eat a muffin, and the world will be engulfed in Derpy time clones.