In China, the proportion of elderly population is growing, influencing economic development and energy consumption. We examine the correlation between China’s population aging and energy consumption in short and long run from 1997 to 2020 using the pooled mean group (PMG) estimation and debate the mechanisms behind it based on mediating effects and threshold effects models. According to the PMG results, for energy consumption, the long-term impact from population aging is negative, with each 1% population aging increase leading to a 0.348% decrease in energy consumption. GDP per capita and capital stock have positive correlations with energy consumption, while industrial structure is negatively correlated. Technological progress significantly increases the amount of energy consumption. The scale and technological effects is responsible for the mediating role in the negative effect of population aging on energy consumption, according to the mechanism analysis. Moreover, both population size and technological progress construct the nonlinear relationship between population aging and energy consumption. Policy implications suggest a comprehensive approach to reducing population growth, improving energy efficiency, and promoting sustainable technologies while promoting sustainable economic development.