In Bible times, a marriage was arranged through a legal agreement between the parents of the groom and the bride (Gen 24:4). The groom’s parents selected a woman for their son to marry, then paid the bride’s parents a dowry, or bride-price, to compensate them for the loss of her services as a daughter.
The period between the time of this legal agreement and the actual marriage of the couple was known as the betrothal. The future groom and bride were espoused or pledged to each other during this time in a formal agreement that was as legally binding as marriage itself. The betrothal could be broken only by a legal proceeding similar to a divorce.
It was during the time of her betrothal to Joseph that Mary discovered she was pregnant. This was certainly grounds for Joseph and his family to dissolve their marriage agreement with Mary and her parents.
But Joseph was informed by an angel that Mary’s pregnancy was due to the miraculous action of the Holy Spirit. This child from her womb would be the Messiah, the Son of God, who would “save his people from their sins” (Matt 1:21).
Joseph believed this message from the Lord, and he proceeded with his plans to take Mary as his wife (Matt 1:24)
MATTHEW 1:18 – When as his mother Mary was espoused [pledged to be married, NIV] to Joseph, before they came together, she was found with child of [through, NIV] the Holy Ghost [Holy Spirit, NIV].