Well lets see, we know that Rainbow Dash and Fluttershy grew up together in Cloudsdale and that it was Rainbow's Sonic Rain Boom that changed everyone's life. This event caused Fluttershy and Rainbow to move to Ponyville. In that time, Pinkie Pie had to leave her family and travel into town and Applejack had to move back from Manehatten. So its really all a question of how much time elapsed between the Sonic Rain Boom and Twilight moving to Ponyville for her studies. I'd imagine it probably wasn't a lengthy history probably just enough to become settled and get to know each other. I believe Twilight pulled the group together.