Smarty Pants was handmade by Princess Celestia and given to Twilight Sparkle as a gift when she was a filly. Since she was made by the most powerful magic pony in all of Equestria, Smarty Pants keeps a lot of magic in her. That combined with the experiments of Twilight trying to move innanimate objects leaded to Smarty Pants to become real, but that's a fact that just a small amount of ponies actually know (Not even Twilight know).
When Twilight moved to Ponyville, she took Smarty Pants with her and lived with her until some events around a "want it, need it" spell lead her to end up in possession of Big McIntosh who is her official owner nowadays.
Smarty Pants is really skilled at teaching and has a wide knowledge thanks to the study sessions with Twilight.
She can also transform herself into a real pony at will and can understand the language of baby ponies.
She considers Jim (a special jar of the Jim peanut butter brand) to be her best friend and also has a special relationship with her owners: Twilight and Big McIntosh, even if they don't know that she's real. Lately she end up at Sugar Cube Corner to "take care" of Pumpkin Cake and Pound Cake.