Scripture contains many promises about protection, including this one. It is appropriate to remember such promises in prayer, looking to God for protection.
Sometimes, however, God’s people suffer. In fact, some texts warn us to expect this (2 Tim 3:12). So while we can trust that not a hair from our head will fall to the ground apart from our Father’s plan for us, this does not mean that we will not face attacks—only that God has everything under control and the final outcome is his.
The context of this passage focuses on God’s people. Israel had sinned, been judged, but now would be restored, and those who had tried to oppose Israel would be crushed. God would fulfill his promises to his people; he judged them when they sinned but now that they had turned back to him, he would restore them, and nothing could stop his plan.
There is a principle here that God vindicates his people; but it is not an ironclad guarantee for every circumstance in the short run for each individual. (For example, though God often does provide protection for Christians, he does not do so all the time; many Christians have died as faithful martyrs.)
It does encourage us, however, that God will ultimately vindicate his servants and his plans for history. So whatever we must face in the short run, in the long run we can be sure of God’s faithfulness and vindication if we remain faithful to him.