The type of bedrock and soil in an area affect nutrient availability and water retention. Sandy soils drain quickly, favoring species that tolerate dry conditions. Clay-rich soils retain more water, favoring moisture-loving species. Soil pH is also a factor. Acidic soils support different plants compared to alkaline soils.