2 Peter 1:21 (NIV), “For prophecy never had its origin in the human will, but prophets, though human, spoke from God as they were carried along by the Holy Spirit.” Zacharias was moved by the Holy Spirit. Luke 1:68-70 is the first division of this prophecy: praise to God. He spoke of the redemption work to be accomplished by Jesus, and Zacharias was praising the Lord and that the time had come to accomplish the great blessing which He long ago had promised.
The second section is from verses 73-75, “the oath he swore to our father Abraham: to rescue us from the hand of our enemies, and to enable us to serve him without fear in holiness and righteousness before him all our days.” It is praise for the deliverance of Israel (and of all mankind) and from the enemies of Satan, sin, and, ultimately, death.
The third section tells us how John the Baptist would be the forerunner of Jesus, to pave the way for this great work of salvation. Luke 1:76-79, “And you, my child, will be called a prophet of the Most High; for you will go on before the Lord to prepare the way for him, to give his people the knowledge of salvation through the forgiveness of their sins, because of the tender mercy of our God, by which the rising sun (Jesus, 2 Peter 1:19) will come to us from heaven to shine on those living in darkness and in the shadow of death, to guide our feet into the path of peace.”
We read of John fulfilling this prophecy in Matthew 3:1-3, “In those days John the Baptist came, preaching in the wilderness of Judea and saying, ‘Repent, for the kingdom of heaven has come near.’ This is he who was spoken of through the prophet Isaiah: ‘A voice of one calling in the wilderness, ‘Prepare the way for the Lord, make straight paths for him.’” (See Isaiah 40:3 and Malachi 3:1.)
Thus, the Holy Spirit moved Zacharias to declare the mission of his son, John.