Jesus applies this passage to himself in Matthew 26:31-32. Here we see a divine sword in the hand of the Father about to be used against his Son. One commentator stated that 'there is nothing in the whole compass of human knowledge, nothing more awfully sublime, than this seeming schism in the Godhead.'
Why is it happening? The answer is that Jesus, the Shepherd chosen by God in eternity, has become answerable for the sins of his people. The sword is the sword of divine justice. As we read the prophet's prediction, we can see how awful sin is in that it could only be forgiven if Jesus endured the penalty.
Yet Jesus was not an ordinary Shepherd. True he was a man, yet he was also the Son of God, equal with the Father. Here is an Old Testament statement that Jesus would be both God and man.
His work on the cross would be followed by the deliverance of a remnant of believers. They would be brought by God through fiery trials, but the effect of the trials will be an increase in prayer. The prophet brings together the need for trusting in Jesus our deliverer and of developing a life of prayer to the one who smote his Son instead of us.