Zechariah in this passage encourages the people of Judah to trust in the Lord. At the beginning of the chapter he reminds them that it is the Lord who sends to them the rain that helps bring about the harvest. Since this is the case, it is foolish to listen to false prophets who suggest that the people should trust in something else.
One danger of false shepherds is that they lead the people astray. One consolation is that the Lord will punish false shepherds because he cares for his flock. Although the false shepherds weaken them, he promises to restore his people and make them into a strong army able to defeat their enemies.
Things may not have looked like that when Zechariah made this prediction. Most of the Jews were still in the places where God had exiled them. Their forefathers had been sent there by God because they had rejected him, but here he says that their children (descendants) will follow him.
God will them back even from Assyria and Egypt, locations that were far away geographically, but also locations that were symbolic of the intensity of the punishment they had received and of the weak state into which they had descended. Nevertheless their covenant Lord will renew their strength and when he does bring them back, they will be so numerous that they will fill the land.
As far as literal Israel was concerned, they have not yet experienced such a return to their land. Yet this description of the restoration of Israel is a graphic picture of the growth of the church of Christ. The church often finds itself led astray by false shepherds, and for that folly it is chastised with spiritual powerlessness. Nevertheless God loves his cause and will return and re-empower the descendants of those he punished. This has happened several times in the past when God sent revival to his church.
Today the church in our country is in exile, in a short time it may be a mighty army. Therefore those today who are like the Jews of Zechariah's day, who were rebuilding the temple, can be encouraged by knowing their God has great plans for his cause.