Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
The first human societies were Muslims. They all worshipped Allah alone. These continued for centuries. Then some human beings turned away from Islam. So, Allah sent them Prophet Noah (Alaihi Salaam). Some of them became Muslims and others refused Islam.
But monotheism is the initial state and polytheism is an innovation by human beings. So, the progeny of the non-Muslims followed them in being astray. But none of their descendants will be punished unless they become mature and the call to monotheism reaches them, they refuse to abide by it and prefer to fulfill their desires and instincts imitating their predecessors. Since this is their situation, they deserve Hell-fire because they chose Kufr and refused Islam. Allah Says (interpretation of meaning): {…We never punish until We have sent a Messenger (to give warning).}[17:15].
The same applies to the children of Muslim parents if they reach the age of puberty and choose Kufr, they will be considered as apostate and will then be thrown in Hell-fire forever, and Islam of their parents does not help them in this case.
Allah knows best.