Did John the Baptist know who Jesus was while in his mother's womb?
Mary and Elizabeth were first cousins. So when Jesus was in Mary’s womb, Elizabeth was already pregnant with John but 6 months advanced in pregnancy. The leaping that is happening within Elizabeth’s stomach (womb), is John sensing Jesus in the womb of Mary. It’s as if the Holy Spirit is letting John know, the person that he is about to announce (at least in baby language) is right here – meaning the Messiah.
When you begin to see John going into the wilderness, and in Luke’s gospel when he begins to see Jesus coming, John lets the people know “I will let you know when the Messiah is coming”. I can only imagine that John once again leaps in his spirit. And he lets the people know, this is the Messiah the One in whom you have been waiting for.