Kabbalah teaches that even the forces of evil are agents of the Divine Plan.
The Fallacy of Numbers Moab was scared of Israel because he perceived that they were attached to a great ruler over the entire Creation. Translated and annotated by Rahmiel-Hayyim Drizin from PaRDeS HaBahir