You don't want the floor sitting directly on the soil, and it's cheaper to pour the foundation around the edges of the house than to pour a solid concrete slab.
It also allows you to access things like ductwork and whatnot.
Subterranean termites living in the soil will have instant access to the wood in your home.
Also the soil can get damp from rain/poor drainage and cause mold and mildew problems.
A slab adds a physical barrier to prevent this but it is very difficult to modify or repair anything built into the slab. For example the drain pipe.
The crawl space acts as an air barrier and allows for easier access to plumbing or HVAC systems. It also takes less concrete since you only pour in the perimeter of the house for the foundation.
in general, there are a few different types of "foundations" used for housing. you have a raised foundation, where there are concrete posts with wood panels built on top of them. this type of foundation creates the "crawlspace" which can be used to access below the floor. this is a cheap method of building houses, and might be suitable for areas with flooding.
the other type of foundation is a solid concrete slab. this is just as it sounds, and costs more (because concrete expensive) and can be prone to flooding if the water level rises above the slab. but is more sturdy.
Sometimes the water table is too high to have a basement. I live just south of Houston Texas, if you dig more than 2 feet deep the hole fills up with water overnight. Any basement here would fill up with water.
Sufficient-Green-763 t1_jds68j2 wrote
You don't want the floor sitting directly on the soil, and it's cheaper to pour the foundation around the edges of the house than to pour a solid concrete slab.
It also allows you to access things like ductwork and whatnot.