Basically, Scootaloo was either abandoned or her parents died or something and she was put in the system from a very young age. She was bounced around from foster home to foster home, some better than others, but most were various levels of terrible. She ended up in a really bad one for a long time. The type who puts locks on the fridge and cupboards and takes to hitting the kids to the point of them being regularly in the hospital, but are well-liked enough by the town so that no pony would do anything to stop them. Until a new Nurse in the local Hospital catches on. Nurse Redheart bonds with the little filly, and promises to do whatever she can. It takes a while, but she eventually gets the foster parents taken away. Out of fear of Scootaloo going back into the system and into an even worse home, she adopts her and moves them to the only place she can go to on short notice, her cousin’s home in Ponyville.
I may or may not write this out in full.