“Now it came about after this that the sons of Moab and the sons of Ammon, together with some of the Meunites, came to make war against Jehoshaphat.”
‭‭2 Chronicles‬ ‭20:1‬ ‭NASB‬‬
The multitude of enemies gathered together to attack Judah right after King Jehoshaphat was rebuked, and in repentance, instituted several excellent reforms (19:5-11). If Jehoshaphat responded so sincerely, why would the Lord allow a multitude of enemies to come up against His people as the very next part of their story?
One thing we see from the end of the story that He wanted to bless His people:
“When Judah came to the lookout of the wilderness, they looked toward the multitude, and behold, they were corpses lying on the ground, and no one had escaped. When Jehoshaphat and his people came to take their spoil, they found much among them, including goods, garments and valuable things which they took for themselves, more than they could carry. And they were three days taking the spoil because there was so much.”
‭‭2 Chronicles‬ ‭20:24-25‬ ‭NASB‬‬
In the new covenant, we know that the Lord isn’t interested in showering us with material riches, but the spiritual principle still applies: He wants to make us spiritually rich by allowing us to face fierce enemies. Isn’t it amazing to see that the Lord allows us to face enemies and resistance, specifically because He wants to enrich our lives spiritually?
Do you view enemies like that? That every enemy that the Lord allows to come upon you, He allows it with the hope and intention that you might become spiritually rich? I want to view every enemy — even my flesh — in that way! Why has God allowed me to remain in the flesh, with this wicked enemy that is literally attached to my person? Because He wants me to be spiritually rich, strong, abundant in His grace, practiced in the way of the cross, that the life of Jesus might be manifested through my life (2 Corinthians 4:10-11). 
But His people’s riches weren’t God’s only goal in allowing them to face fierce enemies. I want to point out a few other reasons the Lord allowed His people to face enemies, so that we in the new covenant can draw strength and conviction from their example. 
Other reasons God allows us to face enemies:
2 - He wants us to seek Him— “Jehoshaphat was afraid and turned his attention to seek the LORD, and proclaimed a fast throughout all Judah. So Judah gathered together to seek help from the LORD; they even came from all the cities of Judah to seek the LORD.”
‭‭2 Chronicles‬ ‭20:3-4‬ ‭NASB‬‬
Every pressure is sent to drive us into our Father’s arms. If we could only see how God allows every difficulty we face in His mercy, because He knows how prone we are to wander. It says many times in Judges that, “as soon as they had rest, they did evil before Him...” 
Having needs is a precious gift that God gives that we might not forsake Him, but instead continually draw near to Him. 
3 - He wants us to claim His promises— “Did You not, O our God, drive out the inhabitants of this land before Your people Israel and give it to the descendants of Abraham Your friend forever? They have lived in it, and have built You a sanctuary there for Your name, saying, 'Should evil come upon us, the sword, or judgment, or pestilence, or famine, we will stand before this house and before You (for Your name is in this house) and cry to You in our distress, and You will hear and deliver us.’”
‭‭2 Chronicles‬ ‭20:7-9‬ ‭NASB‬‬
This is actually part of the agreement that Solomon made with the Lord in 2 Chronicles 6 — and the pressure reminded the people of God’s promise. God is so eager for us to be reminded of His promises, that He will allow enemies to come, that we might seek His face and search His word for promises to strengthen us according to our need. Often, He gives us a promise, and we can neglect it through watchlessness. But when the enemies come, we run to God’s Word and strengthen ourselves in Him. 
4 - He wants to remind us of our true weakness and defenselessness— “O our God, will You not judge them? For we are powerless before this great multitude who are coming against us; nor do we know what to do, but our eyes are on You."”
‭‭2 Chronicles‬ ‭20:12‬ ‭NASB‬‬
We can drift through life growing more and more confident in ourselves, our strengths, and our abilities. The Lord allows fierce enemies to come to remind us of the fundamental truth that we are nothings, and we have no hope in this world except Him. It says that Jesus holds all things together by the word of His power (Hebrews 1:3), and the presence of an enemy is an excellent reminder of just how fragile our illusions of strength really are. 
5 - He wants to demonstrate His power to us, to grow our confidence in Him— “You need not fight in this battle; station yourselves, stand and see the salvation of the LORD on your behalf, O Judah and Jerusalem.' Do not fear or be dismayed; tomorrow go out to face them, for the LORD is with you." Jehoshaphat bowed his head with his face to the ground, and all Judah and the inhabitants of Jerusalem fell down before the LORD, worshiping the LORD.”
‭‭2 Chronicles‬ ‭20:17-18‬ ‭NASB‬‬
Just as Jesus was MORE exalted in His disciples’ eyes after calming the storm (Luke 8:25), so also is our Father MORE deserving of our trust in our own sight after every deliverance. He allows us to face difficulties because He is always interested in increasing our confidence in Him!
6 - He wants to give us an opportunity to praise Him in FAITH — “When he had consulted with the people, he appointed those who sang to the LORD and those who praised Him in holy attire, as they went out before the army and said, "Give thanks to the LORD, for His lovingkindness is everlasting." When they began singing and praising, the LORD set ambushes against the sons of Ammon, Moab and Mount Seir, who had come against Judah; so they were routed.”
‭‭2 Chronicles‬ ‭20:21-22‬ ‭NASB‬‬
We have plenty of reasons to praise God in fact— for the facts of His goodness, His calling, His mercy, His love. All the things we have already experienced to an extent. But the Lord wants to establish a people who are so unshakeably confident in Him that they praise Him beforethey see the outcome. When an enemy assaults, He gives us a chance to praise Him in faith for what we have not seen Him do yet, but for what we believe He will do. 
7 - He wants to establish an undeniable testimony of His power among the people of the world— “And the dread of God was on all the kingdoms of the lands when they heard that the LORD had fought against the enemies of Israel.”
‭‭2 Chronicles‬ ‭20:29‬ ‭NASB‬‬
God’s desire in setting apart a people for Himself has always been that, by His presence in their midst, they might establish a testimony of His being, His power, and His goodness among the peoples of the world (Ephesians 3:10). One way He causes the world to wonder is by allowing His people to face impossible-seeming situations. Every time He delivers His them, He establishes a testimony of His trustworthiness among the unbelieving world. Thus His glory goes forth, by allowing His people to face adversity, and triumphantly overcome by His power. 
8 - He wants to burn away impurity among His people— “The high places, however, were not removed; the people had not yet directed their hearts to the God of their fathers.”
‭‭2 Chronicles‬ ‭20:33‬ ‭NASB‬‬
Sadly we see here that God’s purposes are not automatically fulfilled. I do believe that God had it in His heart to cleanse His people of their idols by demonstrating His power and His care over them in the face of these enemies. But we see that this purpose was NOT fulfilled, because the people we unwilling to turn. Despite having sought the Lord, despite having seen His power, despite having become materially wealthy from the victory He wrought among them, yet they did not fully direct their hearts to God. 
And that is His ultimate desire in allowing us to face enemies: a people refined by fire, zealous for His name and glory, offering a pure offering to Him in righteousness. “He will sit as a smelter and purifier of silver, and He will purify the sons of Levi and refine them like gold and silver, so that they may present to the LORD offerings in righteousness” (Malachi‬ ‭3:3‬).‬‬
But it is not automatic. And just because one purpose is realized, doesn’t mean that ALL God’s purpose will be fulfilled. Let us seek the Lord radically, that in addition to all the other points here, we might be purified to offer up a life that is pleasing to Him - our spiritual service of worship (John 4:23, Romans 12:1).