The Mother of the King is his Queen.
Mary’s role as Queen is because, amongst the Hebrews, who had multiple wives and multiple concubines, the Mother of the King is his Queen. So if you look through all the Hebrew Kings, you know exactly who each one’s mother is, whether or not you happen to know who his wives or concubines were.
If you look at Bathsheba, in the Old Testament (in the Book of Kings), she was Queen because her son was Solomon— not because she was David’s wife. (In other words, she was Queen during Solomon’s reign, not during David’s reign.)
As was mentioned above, Adonijah (one of David’s other children) asked for Bathsheba to intercede for him with Solomon. If you recall what he asked for, he asked to marry someone from David’s harem, whose purpose had been to keep his bed warm, but he had never had intercourse with her. Taking possession of the (former) king’s concubines was one way of declaring your intent for the throne. Which was why it ended the way it did for Adonijah.
So, Bathsheba is one “type” for Mary, just as Eve was— a type being something in the Old Testament that prefigures something in the New Testament. Just like how the manna in the desert prefigures the Eucharist, or circumcision prefigures baptism, or how Joseph in the Old Testament prefigures Joseph in the New Testament, or how Abraham’s sacrifice prefigures Jesus’ sacrifice, or whatever. But the difference between Bathsheba and Mary is that Bathsheba requested something contrary to the will of Solomon because she had promised Adonijah she’s ask for whatever he wanted— but Mary never requests anything contrary to the will of God.