Peter describes how Old Testament prophets foretold the sufferings of Jesus.
Zechariah's prophecy spoke of the judgment and rescue of Israel, and the appearances of Messiah.
In Zechariah 9, Messiah's first coming is described: Jesus would come in lowliness, justice, riding upon a donkey, and bringing salvation to the people.
But it was the lowliness that caused the people to reject Messiah. They wanted a king riding on a war horse, and they didn't need the kind of salvation Jesus brought, salvation from their own sins. That was offensive, and so they put Him to death on the cross.
The next appearance of Messiah comes in Zechariah 12, in the context of the rescue of Israel from all its enemies by Messiah.
In that day, Zechariah writes, God will pour out on Israel His Spirit of grace and supplication. The Holy Ghost will work a great work of regeneration, bringing Israel spiritually to life from the dead. No longer will she depend on works righteousness, but she will cry out to God for mercy and forgiveness. Israel will cast aside her own deeds, and seek God's righteousness by grace through faith in His promise of redemption.
But when Messiah is seen this time, all Israel is reminded of what they did to Him the first time He came to them with salvation: they pierced Him, they cut Messiah off, they conspired with their Roman occupiers to put Jesus to death.
So He comes again to save them, and recalling what they had done to Him, they are filled with mourning and great bitterness.
Here we have the final unambiguous admission in the Old Testament of who cut off Messiah. When they see Him next, they will recall how it was they themselves that killed Him.