Allaah decrees disasters for children – why?
Question

I have my friend non-muslim, i was traying to help her to know the real religion in front of Allah, one of the question she asked me is this  "I understand the belief that God is testing, to use your example, the one mother who put her child in a dust bin because she didn't want it and she miserably failed her test of love. And the woman who had so much love and desire to have a child stole one in order to fulfill her desire. She failed her test too because of the wrong way she got a child. I am not questioning the adults who did wrong. I am questioning the rationale pertaining to the children. In other words, was God testing the little baby by allowing his mother to dump him in a dust bin? What type of test is this? Is a child whose parent physically harms it being tested? What type of test is that? What is the child supposed to be tested for? How much pain it can withstand? So, my question pertains to the innocent -- not to the guilty. Why would God allow such innocents to be harmed worldwide?? I don't understand that"?
Praise be to Allah.Who is praised in all languages, worshipped at all times, Whose knowledge encompasses all places, and Whose attention is never distracted from anything. Glorified be He above having any peer or rival, and exalted be He above having any wife or child. His ruling applies to all His slaves. 
“There is nothing like Him, and He is the All‑Hearer, the All‑Seer”
[al-Shoora 42:11 – interpretation of the meaning]
And blessings and peace be upon the one who was sent as a mercy to the worlds and as proof for all of mankind. He conveyed the message and fulfilled the trust, and strove for the sake of Allah in the truest sense, until he left us with a clear path whose night is as clear as its day, and no one deviates from it but he is doomed… 
We must note that anyone who believes in the existence of Allah and that He is the Lord and Creator, even if this believer in the existence of Allah is not a Muslim, knows that this Lord is distinct from His creation in all aspects. There is no room for likening or comparing Him to His creation. Hence Allah says: 
“There is nothing like Him, and He is the All‑Hearer, the All‑Seer”
[al-Shoora 42:11 – interpretation of the meaning]
If the owner of an item in this world can dispose of it however he wishes without any person bringing him to account for that because it is his property, then Allah the Creator – like unto Whom there is none – may dispose of His “property” however He wills. We Muslims have certain faith that our Lord Who created us has the utmost wisdom which cannot suffer the slightest shortcoming whatsoever. Rather everyone who believes in the existence of the Lord and accepts Him as his Lord must believe this, otherwise he is believing in an imperfect Lord, and the one who has the least reason and faith knows that there can be no Lord Who is not perfect in every sense and far removed from any imperfection.  Otherwise he is not a Lord in any real sense. We in turn, because we are part of the creation of Allah, cannot comprehend any part of His wisdom unless He tells us of it. What He has taught of the reasons behind His actions, we understand and accept; what He has concealed from us and kept the knowledge thereof to Himself, we believe in it and we know that He does not do anything unless there is great wisdom behind it, because He is the All-Wise and All-Knowing. It should never, under any circumstances, cross our minds to think that we can bring Him to account for what He does in His dominion and creation, otherwise we will be transgressing upon the preserve of Lordship and overstepping the mark, if we claim that we can know what He knows. No one can utter such words except a heretic who does not believe in the existence of a Lord in the first place. We seek refuge with Allah from that. 
If we accept the words of human specialists when they are dealing with their specialties, and we do not argue with them – such as doctors, engineers, etc. – because our educational level does not enable us to understand everything that they know, then it is even more appropriate that we should accept that however the All-Knowing, from Whose knowledge nothing is hidden, deals with the affairs of His creation is undoubtedly correct and wise. 
We humans sometimes think that it is wise to do some things that we dislike, because there is some benefit in that for us, and if we did not do them we would be accused of being lacking in wisdom and reason. For example, if a person is sick and there is the fear that he may die, but it is known that he may be cured – by Allah’s leave – if he takes a certain medicine, then the wise thing for him to do is to take that medicine even if it is bitter; if he fails to take it, that is regarded as a shortcoming and lack of reason on his part. There are many things that we do in life that we dislike, because of the benefits that they bring to us. 
For Allah is the highest description (cf. al-Nahl 16:60), and there is no way that He can be compared to His creation. He allows some things to happen in His dominion that He hates, because they serve a greater wisdom which we, or most of us, cannot comprehend.  Some of His wisdom may become clear to us, and that is by the mercy of Allah towards His believing slaves, as He shows them some of His wisdom in this world so that they might find peace of mind. For example, if we want to ask about the reasons for something we could understand, such as why Allah creates a child then causes him to die, perhaps if that child lived he would have committed major sins such as those that doom a person to Hell, and that would have condemned him to remain in Hell for eternity, or for a very long time, or he may have caused others such as his parents to deviate from the path of Allah – as mentioned in the story of the boy whom al-Khidr killed, as told in the story of al-Khidr and Moosa in Soorat al-Kahf. 
Alternatively, if this child lives he may face such difficulties that in his case death is a mercy from Allah. 
Moreover, if Allah creates him handicapped, perhaps this handicap will prevent him from committing many sins which, if he did them, would lead to his being punished on the Day of Resurrection. 
Not every sickness or handicap is necessarily a punishment; rather it may be a test for the child’s parents, by which Allah will expiate for their bad deeds, or raise their status in Paradise if they bear this trial with patience. Then if the child grows up, the test will also include him, and if he bears it with patience and faith, then Allah has prepared for the patient a reward that cannot be enumerated. Allah says (interpretation of the meaning): 
“Only those who are patient shall receive their reward in full, without reckoning” [al-Zumar 39:10] 
For us Muslims, life does not end when we die, rather we believe that beyond death there is Paradise and Hell, in which is true life.  Those who did good will find the reward for the good deeds that they did in this world, waiting for them with Allah, and those who did evil will find the punishment for their evil deeds waiting for them. Good and evil cannot be equal, and the patience of the one who was tested and bore it with patience will not be wasted with Allah. Indeed, those who were not tested in this world may wish that they had suffered similar calamities when they see the high status attained by those who bore calamities with patience. There is a great deal of evidence to this effect in the Qur’aan and Sunnah, for example: 
Allah says (interpretation of the meaning): 
“And certainly, We shall test you with something of fear, hunger, loss of wealth, lives and fruits, but give glad tidings to As‑ Saabiroon (the patient)” [al-Baqarah 2:155] 
The Messenger of Allah (peace and blessings of Allah be upon him) said: “How wonderful is the affair of the believer, for all of it is good, and that applies to no one except the believer. If something good happens to him he gives thanks, and that is good for him, and if something bad befalls him he bears it with patience, and that is good for him.” (Narrated by Muslim, 2999). 
From this it should be clear to you that the calamities that befall those who seem to us to be innocent, and indeed happen to all people, are not necessarily a punishment, rather they may be mercy from Allah, but our minds and reason are imperfect and are often unable to understand the wisdom of Allah in such matters. Either we believe that Allah is more just than us, and more wise, and more merciful towards His creation, so we submit to Him and accept (His will), whilst also acknowledging our inability to understand the true nature of our own selves; or we boast of our imperfect reason and feel proud of our weak selves and insist on calling Allah to account and objecting to His decree. Such thoughts can never cross the mind of anyone who believes in the existence of a wise Lord, Creator and Sovereign Who is perfect in all ways. 
If we do that then we have exposed ourselves to the wrath and vengeance of Allah, but nothing can ever harm Allah. 
Allah drew attention to this when He said (interpretation of the meaning): 
“He cannot be questioned as to what He does, while they will be questioned” [al-Anbiya’ 21:23] 
A sign of man’s weakness and shortsightedness, is that he focuses on the calamities without paying any attention to the benefits they may bring, and not looking at other blessings that he enjoys and sees around him. For Allah has blessed mankind in ways that do not compare with the calamities that may befall them. If there was a man who does a lot of good but occasionally does not do good, then forgetting the good things that he does would be regarded as ingratitude and denial. So how about when this is our attitude towards Allah, to Whom belongs the highest description, and all of Whose dealings with His creation are good and cannot be bad in any way?
 Moreover, the Prophets and Messengers are the most beloved of creation to Allah, yet despite that they are the most severely tested of mankind and suffer the most calamities – why? It is not a punishment for them and it is not because of their insignificance before their Lord. Rather it is because Allah loves them and has stored for them a perfect reward which they will enjoy in Paradise, and He has decreed that these calamities should befall them so that He might raise them in status. He does whatever He wills, however He wills, whenever He wills; none can put back His judgement, none can repel His command and He is All-Wise, All-Knowing. And Allah is Most High, Most Knowledgeable and Most Wise. 
Note: with regard to what you say about your female friend, it should be noted that it is haraam to establish an illegitimate relationship between a man and a woman. For more information on this important topic please see the fatwas under questions 9465 and 1200 on this site.