The answer is clear in scripture.
NO - Mary did not know that Jesus was ontologically God. The thought would never enter a genuine Abrahamic monotheist’s mind.
It might though if she were told. AND she was told things. Which were later recorded in scripture by evangelists who possibly learned about what was said … from HER.
Luke 1:26 In the sixth month, the angel Gabriel was ***sent from God ***to a town of Galilee called Nazareth, 27 to a virgin betrothed to a man named Joseph, of the house of David, and the virgin’s name was Mary. 28 And coming to her, he said,
“Hail, favored one! The Lord is with you.”
29 But she was greatly troubled at what was said and pondered what sort of greeting this might be.
30 Then the angel said to her, "Do not be afraid, Mary, for you have found favor with God.
31 Behold, you will conceive in your womb and bear a son, and you shall name him Jesus.
32 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,
33 and he will rule over the house of Jacob forever, and of his kingdom there will be no end."
At this point Mary’s initial confusion is answered by an Angel. Who also tells her the HOW of her impregnation since she is a virgin and “does not know man…”. She BELIEVES the message, and agrees with it. She know that “David” is not the real Father specifically but God. She is likely related to the House of David … as is her betrothed, Joseph.
Luke 1:34 But Mary said to the angel, “How can this be, since I have no relations with a man?” 35 And the angel said to her in reply, "The holy Spirit will come upon you, and the power of the Most High will overshadow you. Therefore the child to be born will be called holy, the*** Son of God.***
36 And behold, Elizabeth, your relative, has also conceived a son in her old age, and this is the sixth month for her who was called barren;
37 for nothing will be impossible for God."
38 Mary said, “Behold, I am the handmaid of the Lord. May it be done to me according to your word.” Then the angel departed from her.
39 During those days Mary set out and traveled to the hill country in haste to a town of Judah,
40 where she entered the house of Zechariah and greeted Elizabeth.
41 When Elizabeth heard Mary’s greeting, the infant leaped in her womb, and Elizabeth, filled with the holy Spirit,
42 cried out in a loud voice and said, "Most blessed are you among women, and blessed is the fruit of your womb.
43 And how does this happen to me, that the mother of my Lord should come to me?
44 For at the moment the sound of your greeting reached my ears, the infant in my womb leaped for joy.
45 Blessed are you who believed that what was spoken to you by the Lord would be fulfilled."
Both Mary and Elizabeth were of course monotheistic first century Abrahamic Jews in a sense. But God the Father was communicating to Mary. God the Word was becoming flesh within her. God the Holy Spirit was overshadowing her in place of a human father to that same Son (of God and “man”).
Elizabeth is filled with the Holy Spirit. And calls Mary the “Mother of My Lord”. A person in the Holy Spirit does not call someone other than the Lord “Lord”. Elizabeth in the spirit has knowledge beyond the human too … as she knows of Mary’s belief in what was told her
(in counterpoint to her husband’s skepticism of a lesser miracle when the SAME angel appeared to him in the holy of holies of the Temple to announce that his prayer had been heard and that he would have a “miraculous” son from his aged wife Elizabeth).
Mary sometimes pondered mysteries in her heart. And in these cases may have had the revelation of who Jesus was – revealed to her more and more over time. But she believed.
She did not contradict Elizabeth’s
“mother of my Lord” statement in the Spirit. Not even quibbling with the title “mother” though she was
"ONLY"
the mother of an unborn child at that point (as non-Holy Spirit filled people might reckon it).
The answer to the thread’s question is: YES.
Did she ***ALWAYS ***know? Might be what was meant. But again, the answer is … if not ALWAYS … when was that time, and of how short a duration, when she that believed, only partially knew the extent of His deity?
The Bible records Peter knowing. And Thomas knowing. And proclaiming Him “Son of God” and “Lord”.
Mary’s Holy Spirit Filled “Magnificat” recognizes God as her savior … even before the fact of her Son’s cross.
She gets more information about Him as her life goes on. At his presentation in the Temple where a prophecy of His death is linked by the prophet with a sword that will pierce her heart also. From the testimony of the shepherds and wise men. From Angels appearing to Joseph in dreams and warning her etc.
Hence she is the prototypical “first Christian”. First to accept Him. Learn of Him. Allow herself to be intimate with him spiritually (by serving him day after day and “let it be done unto me” surrender). Once Christ resides inside her … she hastens to help others. She agreed and cooperated with the Holy Spirit … (and the insights go on and on …).
All in all the question is proving to be a fruitful one to ponder.
It is wonderful to have the Church as our light to view scriptures by. Though even the Church doesn’t hold forth and define every detail of scripture.