

In Israel, the queen was not the "wife" of the king since he had many wives, but his mother. We can see her role exemplified during the reign of Solomon in 1Kings 2:13-21).
One day Adonijah, son of Haggish, who was the fourth son of King David born from one of his wives went to see Bathsheba, king Solomon's mother to ask a favor. He said, "Please ask King Solomon, who will not refuse you, to give me Abishag...for a wife." (1 Kings 2:17) Bathsheba agreed and while sitting at the right hand of the King Solomon made known the wish of Adonijah and he granted it. The king usually granted the request of his mother; she had intercessory power with the king.
Mary's Queenship is rooted in the house of David. She was a descendant of David by reason of her marriage to Joseph who is clearly a descendant of David. Through her the promise made to David would be realized. The angel Gabriel revealed to Mary God's purpose at the Annunciation when he affirmed the greatness of the child to be conceived thus,

"He will be great and will be called Son of the Most High,
and the Lord God will give him the throne of David his father,
and he will rule over the house of Jacob forever,
and of his kingdom there will be no end." (Lk 1:32-33)
Mary's visit to Elizabeth brings the joyous realization that God was doing great things in her and that all generations would call Mary blessed. Elizabeth calls Mary "mother of my Lord" (Lk 1:43). St. John Damascene wrote: "When she became the mother of the creator, she truly became Queen of every creature."
Just as Christ is our King not only by natural right but also by what he did to Redeem us, so Mary is our Queen, not only by her gifts of nature but also due to the giving of her substance in the Incarnation, by offering Christ for us and because of her active interest in the salvation of mankind. (Pius XII: Ad Caeli Reginam, No. 35, 37)