The distribution of biota in aquatic ecosystems, including aquifers, is collectively influenced by habitat structure, water quality, seasonality, and local variations in environmental conditions. However, little is known about the nature and relative influences of such factors in groundwater ecosystems. Our aims were to identify the key environmental variables influencing the distribution of biota within the Gwydir River alluvial aquifer in northwestern New South Wales, Australia, and to consider the relative importance of environmental variables, in terms of habitat structure, water quality, seasonality, and site attributes, to both microbial and invertebrate (stygofauna) assemblages. Stygofauna distribution was primarily influenced by habitat variables (predominantly sediment structure) followed by site variables (abundance of trees), with water quality and seasonality having relatively little influence. These results indicate that it is the aquifer conditions relating to habitat structure, water flow, and the supply of organic matter that are most important for determining stygofauna distribution. Microbial assemblage structure was not strongly correlated with habitat variables, possibly because habitat restraints do not exist because of their smaller size. Instead, seasonality and water-quality variables had the greatest influence on microbial assemblages. Microbes might respond to seasonal (particularly rainfall induced) changes in water quality more quickly than do stygofauna, which may explain the relatively greater importance of seasonality and water quality to microbial assemblages. Given that stygofauna are most influenced by habitat and site variables, and microbial assemblages are most influenced by seasonality and water quality, disturbance to any of these factors may threaten the stability and integrity of the groundwater ecosystem.