Praise be to Allah, and may peace and blessings be upon the Messenger of Allah.
Children bear no sin, but Allah تعالى is Wise and All-Knowing. He tests His servants with good and evil, prosperity and adversity, for great wisdoms, and not every affliction is caused by a sin.
Among the wisdoms behind children being afflicted with illnesses and disabilities are: testing the patience and gratitude of their fathers, mothers, and relatives; showing people the power and wisdom of Allah; and reminding them of the blessing of health and well-being. Likewise, whoever is tested by having a sick child, then remains patient, seeks reward from Allah, and believes in Allah's decree and destiny, will receive a great reward for his patience and seeking reward from Allah.
Therefore, it is not correct to say: “How can a child become ill when he has committed no sin?” Illness is not necessarily a punishment. Rather, it may be a test for the child and his family, and it may contain wisdoms and benefits that a person may understand or that may remain hidden from him.
As for the fate of children in the Hereafter: the children of Muslims will be in Paradise with their families, and this is among what the scholars of Ahl al-Sunnah wa al-Jama'ah have stated.
As for the children of disbelievers, the Prophet ﷺ said, when he was asked about the children of the polytheists: “Allah knows best what they would have done.” A group of scholars held the view that they will be tested on the Day of Resurrection. Whoever obeys will enter Paradise, and whoever disobeys will deserve the Fire, because Allah تعالى does not punish anyone before the proof has been established against them. He سبحانه said: “And We never punish until We have sent a messenger.” [Al-Isra': 15]
In summary: A child's illness or disability is not evidence of any sin committed by the child. Rather, it is a test that Allah brings about with wisdom, and it may be a cause of reward for the child and his family and of raising their درجات. We must believe in Allah's wisdom, remain patient, and seek reward from Him. The children of Muslims are in Paradise, while regarding the children of disbelievers, the relied-upon view is that they will be tested on the Day of Resurrection.
And Allah knows best.