Twilight was originally born in Ponyville, but her parents moved her and her brother to Canterlot at a young age, so she didn’t remember anything about the small town.
Since her early childhood, Twilight showed an innate talent for magic. This was one of the reasons why her parents decided to move, to give their daughter more opportunities to study her own powers.
At the age of 5, after passing the entry exam, and getting a new baby brother in the process (Spike) she started to study at the Celestias Academy for Gifted Foals. She quickly became the best student of the first year, whish garnered some unwanted attention. Twilight was always somewhat reclusive. She preferred books and studying instead of playing with foals her age. This reason quickly isolated her from the rest of her classmates. Not only that, but she became the target of bullying. Not only was she the youngest in her year, the best student of the class, but also because she was only half unicorn, her mother was an earthpony. There still was great judgment among unions (especially the upper class) and purity of their blood. But Twilight didn’t care much about the teasing that she was getting, she didn’t need friends, she had books and her family.
After showing her great achievements in studies and practical magic, Twilight was chosen to be a personal student of princess Celestia. Even though it was intimidating to Twilight at first, she quickly learned not to fear the princess and started to admire her for her wisdom and power.
During her last year at school, Twilight became good friends with rarity. The two were in different classes, but they crossed passes several times during the years. Rarity was one of a few ponies at the academy who didn’t just Twilight for her behavior or background, quite different, Rarity was amazed by this fillies determination and skills in magic.
After the graduation, twilight was called by the princess to a personal meeting. There, she gifted Twilight a book with some old legend about nightmare Moon, and tasked her with a mission in a small town called Ponyville. Twilight was very reluctant with that, she already was planning to stay at the Canterlot and move to Princess’ castle to continue her studies of ancient magic in the castle library. But at last, she couldn’t disobey the ruler of Equestria, at least Rarity and Spike will be accompanying her.
Despite her original reluctance to go, in the end, arriving at Ponyville was the best thing that could have happened to Twilight! She found there amazing friends, learned a lot of valuable life lessons and went on the great life-changing adventures!