A thought-provoking question - thanks! Mary was told by the angel that her Child would be the Son of God. Luke 1.34-35:
34 Then Mary said to the angel, "How can this be, since I do not know a man?"
35 And the angel answered and said to her, "The Holy Spirit will come upon you, and the power of the Highest will overshadow you; therefore, also, that Holy One who is to be born will be called the Son of God.
I understand that the last phrase, "be called the Son of God," does not mean (as it might in English), "He will not really be the Son of God; He will just be
called the Son of God."
Then in Luke 1.43, Elizabeth, Mary's relative, says to her:
"But why is this granted to me, that the mother of my Lord should come to me?"
The shepherds were told that a Saviour had been born in Bethlehem, and after their visit, Luke 2.19 says:
But Mary kept all these things and pondered them in her heart.
We know that there were people who knew Who Jesus was. Simeon, for instance. Luke 2.25-33:
25 ¶ And behold, there was a man in Jerusalem whose name was Simeon, and this man was just and devout, waiting for the Consolation of Israel, and the Holy Spirit was upon him.
26 And it had been revealed to him by the Holy Spirit that he would not see death before he had seen the Lord’s Christ.
27 So he came by the Spirit into the temple. And when the parents brought in the Child Jesus, to do for Him according to the custom of the law,
28 he took Him up in his arms and blessed God and said:
29 "Lord, now You are letting Your servant depart in peace, According to Your word;
30 For my eyes have seen Your salvation
31 Which You have prepared before the face of all peoples,
32 A light to bring revelation to the Gentiles, And the glory of Your people Israel."
33 And Joseph and His mother marveled at those things which were spoken of Him.
So I believe that Mary would have had some idea of Who He was, though for a long time those ideas were hazy, and confused.