Ecosystems support food webs by providing a diverse array of habitats and resources that allow different species to interact and depend on each other for energy and nutrients. Within an ecosystem, various producers, consumers, and decomposers form intricate relationships where energy and nutrients are transferred through a series of feeding interactions. This interconnected network of organisms helps maintain balance and stability within the ecosystem.