2 Chronicles 14:6

And he built fenced cities in Judah: for the land had rest, and he had no war in those years; because the LORD had given him rest.

The Lord gave Asa rest, so that Judah had no war in those years. During that time of peace Asa built fortified cities in Judah. That building was practical preparation for future danger. The cities and preparations made in that peaceful period later served amid invasion. When a vast Ethiopian army invaded, Asa did not rely on those cities or on his army, but trusted God for help.