Once compost is worked into the soil, whether by people or earthworms, it dramatically improves the texture and structure of the soil. Texture refers to the nature of the soil particles. How does a handful of soil feel? Are the soil particles so fine that they pack together tightly, leaving very little space for air so that they get gummy when they are wet? This is typical of clay soils which feel heavy, dense, and solid. Are the soil particles larger, coarser and lighter, their looseness creating so much airspace that water drains through them very quickly? This coarser texture is typical of sandy soil. How much airspace there is in a soil for oxygen and water to be held available for plant roots is very much a function of a soil's texture. It also determines how easy it is for plant roots, especially the tiniest ones, to move through the soil searching for the food and moisture it contains. A very sandy texture is great for root growth, but doesn't hold enough water or nutrients to sustain the plants. The heavy clay soil is great for holding nutrients but is often so compacted that roots are unable to grow and access the nutrients.
Between the two extremes of clay and sand is loam. The texture of loamy soil is just coarse enough to retain air and water, yet fine enough to hold it. However, what gives loam its distinctive and ideal texture is the presence of some humus, or decomposed organic matter. Loam's ability to drain well, yet hold moisture and air is enhanced by the presence of humus. Consequently, to the degree that a clayey or sandy soil can be amended with some humus, it is brought closer to the ideal loam with all its good properties.
Adding fresh organic materials to a problem soil in the form of chopped leaves or chopped straw, both organic materials, will ease its compaction and improve its air and water holding capacity, but at a price. Chopped leaves or straw begin to decompose after they are buried in the soil, and as they do, they pull much of the nitrogen in the soil that is available for plants over to participate in the decomposition process. So, while that organic material is decomposing, it is reducing the amount of nitrogen available to the plants. Therefore, fresh organic material in this form is actually a detriment rather than a benefit, at least during the decomposition period. However, if humus in the form of finished compost is added to soil, it does not deplete its nitrogen, since it has already virtually completely decomposed. Obviously, compost can play a major role in modifying the texture of poor soils by serving as the humus component.
A good soil, one that can be characterized as loamy, has a light, crumbly, texture and holds lots of air and water. A soil with those characteristics is called "friable". It is said to have good "tilth". Adding compost to heavy clay soil, gives it more of those qualities. Adding compost to loose, sandy soil, gives it more of those qualities. Even added to loamy soil, which already has some humus, it improves its tilth that much more. Compost is the key to good soil texture. It helps soil of all types perform all the necessary functions. Its presence among soil particles encourages air pockets for water and oxygen, provides some nutrients as it breaks down further, and reduces compaction. It improves the texture of any soil.