Glad I could be of help.
There are unfortunately way too many misconceptions, misinformation and taboos that exist.
Kids of all ages end up in orphanages. In morocco we met a girl whose parents had divorced and then the parent she was with decided to move on with own life and dropped a 7 year old who until that point had a fairly typical childhood, but then saw a divorce and boom she is in an orphanage.
I met other kids whose parents could not afford to take care of them so decided that the kids had a better shot at life living in an orphanage. I met kids whose parents had died but blood relatives were too poor to raise them, so kids lived in orphanage and went to see uncles and aunts for eid.
The idea that this is not an issue in any Muslim country is an uniformed view. But this is not a judgement on anyone, the information is simply not out there and not part of general knowledge.
But there is no religious ruling against raising a child that is not biologically yours in your home. In countries like morocco the kafala is similar to fostering. One would think that with the 'western adoption' not in the way there will be more children who will find homes, but that's not the case. Who gets adopted there? Girls... Walk into an orphanage and see dozens or hundreds of boys and much fewer girls. Why? Because girls are 'adopted' by Moroccan families and then given to their maids to raise to have a child servant and a maid for the next generation ... A concept known as petit Bon. And those are the lucky ones, the less lucky ones are taken and end up in sex trade.
Knowing what I know now, the issue is much closer to my heart than many others because they simply don't know.
Life in orphanages is not great, they vary in how well they are run but abide of all sorts is possible, in the orphanage and outside, because you know,. What standing does an orphan have to go up against some member of society for physical or sexual abuse.
It's a strange cultural mindset and the taboos are based on stuff that clearly is not religion.
USA has a fostering program. Take a step back and honestly ask how well that will work in Pakistan for example. And if the answer states you in. The face, ask why not? The answer to that is much more uncomfortable than as a society we are able to accept. If you want to be even more uncomfortable do some research on orphans due to earth quakes and floods a few years ago, and what happened to them, what is their life. How many are in orphanages and how end up in madrassa a of all sorts, some good and some dodgy ones, bonded labour in farms and factories. Domestic servants... You name it. A functioning fostercare system and a better societal mindset would do wonders for these kids and for society at large for giving them a better shot. But, we don't..it's just not part of broader discussion.