The pain of childbirth is attributed to The Fall of Man in the Bible:
To the woman he said, I will make your pains in childbearing very severe; with painful labor you will give birth to children. Your desire will be for your husband, and he will rule over you. -- Genesis 3:16
As I understand (and, honestly, I'm not too knowledgeable about Christianity), the pain of childbirth is considered a punishment from God for the original sin (a form of "collective punishment" as described on Wikipedia; see also Christianity.SE Why does childbirth still hurt? and Where does the Catholic tradition that Mary did not have pain giving birth to Jesus come from?). As far as I know, it's generally accepted in Christianity that current-day childbirth pain is due to this punishment. (Although, presumably some Christians take this allegorically.)
This goes against the Qur'an:
... And every soul earns not [blame] except against itself, and no bearer of burdens will bear the burden of another. ... -- Qur'an 6:164
Question: Does Islam have an explanation for the pain of childbirth?
Biologically, the explanation seems to be: babies have big heads that need to pass through the birth canal. Google suggests it's result of an evolutionary trade-off: longer gestation results in better development, but bigger heads.
It's possible the "big heads, small birth canals" explanation is the explanation in Islam.
A web page What Are The Rewards of Pregnancy In Islam?, Asma Arshad, Al-Quran Classes, quotes some hadiths:
...if a woman leaves this world during that time because of the hardship and pains of birth, she has the reward of a martyr ... [Makarim al-Akhlāq, pg. 238]
... Any time a woman leaves this world because of labor pains, on the Day of Judgement, Allāh will raise her from the grave pure and without an account (of sins) ... [Bihār al-Anwār, vol. 101, pg. 108]
However, this doesn't give a reason for the pain of childbirth. Also, I'm unsure how reliable this web page and these hadiths are.