From a spiritual and prophetic perspective, the woman is symbolic of the church or congregations of believers, on this note, "childbearing" relates to Revelation 12:5. Every Christian believer has the potential of giving birth to the Christ seed (nature, character, function). This birth takes place in the soul.
A Christian believer can be literally single and literally barren but the soul can still spiritually give birth to the fruit of the spirit, be a High Priest and other Christlike character and functions.
In other words, a Christian should not remain at the level of a:
Foolish virgin (not enough anointing)
Wise virgin (Word and anointing but no birth of a Son)
Bride (Word, anointing, meets the bridegroom but no birth of a Son)
Wife (Word, anointing, marries the bridegroom but no birth of a Son)
The Mother becomes a spiritual Son (From the New Covenant perspective, we need to become the Sons of God who are led by the Holy Spirit because the Son gets the inheritance. This is our childbirth.)
Galatians 4:19 - Berean Study Bible- This is the Son we give birth to
"My children, for whom I am again in the pains of childbirth until Christ is formed in you."
Colossians 1:27 - Berean Study Bible - This is the Son we give birth to
"To whom God has chosen to make known among the Gentiles the glorious riches of this mystery, which is Christ in you, the hope of glory."
This is the reason Tamar tricked Judah to give birth to a Son. Her actions were prophetic.
Deuteronomy 25:5-10 (NKJV) - Marriage Duty of the Surviving Brother
5 “If brothers dwell together, and one of them dies and has no son, the widow of the dead man shall not be married to a stranger outside the family; her husband’s brother shall go in to her, take her as his wife, and perform the duty of a husband’s brother to her. 6 And it shall be that the firstborn son which she bears will succeed to the name of his dead brother, that his name may not be blotted out of Israel. 7 But if the man does not want to take his brother’s wife, then let his brother’s wife go up to the gate to the elders, and say, ‘My husband’s brother refuses to raise up a name to his brother in Israel; he will not perform the duty of my husband’s brother.’ 8 Then the elders of his city shall call him and speak to him. But if he stands firm and says, ‘I do not want to take her,’ 9 then his brother’s wife shall come to him in the presence of the elders, remove his sandal from his foot, spit in his face, and answer and say, ‘So shall it be done to the man who will not build up his brother’s house.’ 10 And his name shall be called in Israel, ‘The house of him who had his sandal removed.’
In many instances, the NT apostles spoke in parables, similitudes, metaphors. They only expounded on the mysteries of the kingdom to mature believers (eyes to see, ears to hear, a heart to perceive the unseen realms). The apostles followed the patterns of the teachings of Jesus.