Twilight was born to a family of “royal” earth ponies. her family only deemed themselves so, because somewhere back in their lineage, they have ties to the actual royal family of unicorns that live in Canterlot. as a result, Twilight thought of herself as better than everypony else, because after all, she was royal and nopony else was. her attitude changed after she moved to Ponyville to advance her studies on science and earth pony magic, and she met the other mane 5. Rarity was the one to knock some sense into Twilight, both metaphorically and physically, as they got into a screaming match/hoof fight with each other.