The Prophet ﷺ said, "Allah has assigned an angel to the womb. The angel says, 'My Lord, a drop of fluid. My Lord, a clinging clot. My Lord, a lump of flesh.' Then when Allah wishes to complete its creation, the angel asks, 'My Lord, male or female? My Lord, wretched or blessed? What is its provision? What is its lifespan?' All of this is then written while the child is still in its mother's womb."
حدثنا أبو النعمان حدثنا حماد بن زيد عن عبيد الله بن أبي بكر بن أنس
عن النبي ﷺ قال إن الله وكل في الرحم ملكا فيقول يا رب نطفة يا رب علقة يا رب مضغة فإذا أراد أن يخلقها قال يا رب أذكر يا رب أنثى يا رب شقي أم سعيد فما الرزق فما الأجل فيكتب كذلك في بطن أمه