There is nothing in scripture that gives us an answer. But there does exist a marvelous account that has been passed down through the ages and held dear by Christians for centuries. Let me share the events that transpired back then.
When King Herod heard from the Magi about the birth of the Messiah, he decided to kill all the infants up to two years old at Bethlehem and the surrounding area, hoping that the new-born Messiah would be among them.
Herod knew about John's unusual birth and he wanted to kill him, fearing that he was the foretold King of the Jews. But Elizabeth hid herself and the infant in the hills. The murderers searched everywhere for John. Elizabeth, when she saw her pursuers, began to implore God for their safety, and immediately the hill opened up and concealed her and the infant from their pursuers.
In these tragic days, Zachariah was taking his turn at the services in the Temple. Soldiers sent by Herod tried in vain to learn from him the whereabouts of his son. Then, by command of Herod, they murdered this holy prophet, having stabbed him while he was between the temple and the altar (MT 23:35). Elizabeth died forty days after her husband, and John, preserved by the Lord, dwelt in the wilderness until the day of his appearance to the nation of Israel. (taken from The Orthodox Church of America website.)
What an amazing demonstration of God's protection for His great messenger, John the Baptizer! Just as Jesus' life was spared from the unbridled fury of Herod, John's purpose and ministry could not be thwarted. And what a moving example of dear Zechariah and his wife as they knew the importance of this child that was given to them in their old age. They were willing to die in order that God's kingdom might be ushered in.
This is only one story that we don't typically hear from the pulpit or in the Sunday school class. Think of how many more there are and how many we will hear about in eternity! Glory to Jesus Christ!