As indicated above, an ideal soil has what seem to be conflicting characteristics. It drains very well while simultaneously holding water very well. When a soil does not drain well, it becomes waterlogged. That means that the water is retained in the soil in most of the little spaces between soil particles that normally hold air. Soil this wet can not offer sufficient oxygen to plant roots and they literally drown. So it is most important that any excess moisture drain away from the spaces between soil particles on down to the water table.
While conventional wisdom says that clay soils tend to drain poorly and that sandy soils drain very quickly, that is not entirely accurate. A key factor in soil drainage is the color of the soil, regardless if it is clay, loam, or sand. Color indicates the presence or absence of iron in a soil has and iron has a major influence on its draining capability. The more iron, the better the drainage. The more iron, the browner the color of the soil. It is possible to have a gray sandy soil that in fact does not drain well at all. Whereas a brown or red clay will drain quite well and be loaded with wonderful nutrients as well. Because compost has some iron in it, the addition of compost to gray soil of any texture will improve its drainage.
Along with good drainage, soil must have the capacity to simultaneously retain some water for use by the roots of the plants. A soil with lots of organic material, in the form of humus, will be able to do just that. As the soil's humus content increases, so does its ability to hold water. Particles of organic matter act like microscopic sponges, soaking up and holding water in sandy soil and opening up spaces in clay soils through which water can move more easily. Increasing the proportion of humus in your soil from 2 to 5 percent by adding compost can quadruple its water-holding capacity.
If you find that the soil in the garden seems dry out quickly and plants need watering frequently, it may be because the soil is not capable of storing much water over time. Add compost to boost its ability to hold water. This will reduce the need to water so frequently and save you time and energy.