done in the Period of Ignorance as a matter of honor and respect for the fathers that their ex-wives be the wives of their sons. As for what happened in the Pre-Islamic Period, it is overlooked and forgiven because that action is detested, disliked and a bad action. That action was detested even in the Pre-Islamic Period.
﴿حُرِّمَتْ عَلَيْكُمْ أُمَّهَاتُكُمْ وَبَنَاتُكُمْ وَأَخَوَاتُكُمْ وَعَمَّاتُكُمْ وَخَالَاتُكُمْ وَبَنَاتُ الأَخِ وَبَنَاتُ الأُخْتِ وَأُمَّهَاتُكُمُ اللَّاتِي أَرْضَعْنَكُمْ وَأَخَوَاتُكُمْ مِنَ الرَّضَاعَةِ وَأُمَّهَاتُ نِسَائِكُمْ وَرَبَائِبُكُمُ اللَّاتِي فِي حُجُورِكُمْ مِنْ نِسَائِكُمُ اللَّاتِي دَخَلْتُمْ بِهِنَّ فَإِنْ لَمْ تَكُونُوا دَخَلْتُمْ بِهِنَّ فَلَا جُنَاحَ عَلَيْكُمْ وَحَلَائِلُ أَبْنَائِكُمُ الَّذِينَ مِنْ أَصْلَابِكُمْ وَأَنْ تَجْمَعُوا بَيْنَ الأُخْتَيْنِ إِلَّا مَا قَدْ سَلَفَ إِنَّ اللهَ كَانَ غَفُورًا رَحِيمًا﴾ [النساء:23]
23 - It is forbidden for you to marry your mothers, daughters, sisters, paternal aunts, maternal aunts, your nieces.
The same ruling goes for your foster mothers and your foster siblings.
It also forbidden for you to marry the mothers of your wives (your mother-in-law), directly after contracting their daughters as well as the daughters of your wives as soon as you have sex with their mothers. However, if you had not sexual intercourse with their mothers, there is no harm to marry their daughters, whether those daughters live in your houses or elsewhere.
It is not permissible for you to marry the wives of your sons whom you begot, unlike the adopted children whose wives may be married by you.
It is forbidden for you to marry two sisters. As for those actions that happened in the Pre-Islamic Period ignorance, Allah overlooked them and forgave you as a mercy for you.