The corona is a structure possessed by stars, including the Sun. The abnormal heating of the solar corona and chromosphere is one of the greatest mysteries in modern astronomy. While state-of-the-art observations have identified some candidates of magnetic activity events that could be responsible for this abnormal heating, and theoretical studies have proposed various heating modes, a complete physical picture of how they are heated as a whole remains elusive. In this study, the characteristics of the heated corona and chromosphere are investigated, and for the first time, the question of how they are abnormally heated is explicitly answered by analyzing the long-term observations of the global chromosphere in the Ca ii K line and the global corona in the coronal green line. The findings reveal that both the quiet chromosphere and corona are in antiphase with the solar cycle, whereas the active chromosphere and corona are in phase with it. Different parts of the solar corona and chromosphere exhibit significantly different variation characteristics and are found to be heated by different magnetic categories and probably in different modes. This study posits that unraveling the heating mystery is best approached through the lens of magnetic categories, rather than magnetic activity events.