From this perspective, the poet wants to express two aspects. First of all, God did not guarantee that his people would not be in trouble or danger. First of all, he promised to protect their safety even if they were in danger.
As the Lord Jesus himself said, "I tell you these things so that you may have peace in me." You have suffering in the world, but don't worry, I won the world. "(about 16:33)