honestlyyy??? equestria doesn't seem like it'd rlly have too many orphanages, if any. canonically the show kinda depicts ponies as being a peaceful and stable species, far removed from the rigors of real life. i mean look at the only ponies who presumably had a rough childhood; cozy glow and starlight glimmer. just the fact she got abandoned by her friend led starlight down a spiral, and cozy glow has no indication of even having a family. sunset shimmer is another who ran away from her home, abandoning her apprenticeship with princess celestia, and became estranged. These are kinda the only examples of dysfunctional homes in the show, unless you count applejack and her parents. but there were many support structures in place for her and her family to counteract the negative feedback loop.
the only examples of villains who aren't thousands(s) of years old were ponies who grew up with a rough childhood, unless you count flim and flam whose cardinal sin was that they were CAPITALIST (lol) or trixie who is, by the way, homeless :3. which is another point, trixie is the only example of homelessness we have in the show and she's a VILLAIN. real life struggle is just something that a pony struggles to deal with. a point could be made for caballeron but he's like, so far removed from mainstream society that everypony thinks he's a myth to the point of doubting his existence when face to face with him :3
the point is, i think that cozy glow had a rough home, a rough childhood, and that's just something that literally never happens to families in the universe, at least not ponies. they've had a thousand years of more-or-less uninterrupted peace, and disrupting that can be something that really changes a pony.