In this review we describe patterns and mechanisms by which habitat complexity is crucial for the functioning of shallow lakes and ponds, and for the abundance and diversity of biological communities in these ecosystems. Habitat complexity is affected by processes acting at different spatial scales, from the landscape to the ecosystem level (i.e., morphometric attributes) that generate different complexities, determining the potential for organisms to succeed and processes to occur, such as energy and nutrient transfer, and fluxes of greenhouse gases, among others. At the local scale, the three major habitats, pelagic, littoral, and benthic, are characterised by different degrees of structural complexity and a particular set of organisms and processes. Direct and indirect effects of changes in within-lake habitat complexity can either hinder or promote regime shifts in these systems. We also review several anthropogenic pressures (eutrophication, urbanisation, introduction of exotic species, and climate change) that decrease lake resilience through changes in habitat complexity and strategies for habitat complexity restoration. Overall, we emphasize the need to preserve and/or restore habitat complexity as key challenges to account for ecosystem integrity, maintenance of local/regional biodiversity, and for the provision of crucial ecosystem services (e.g., biodiversity, self-purification, and carbon sequestration).