Understanding the specific chemical activation mechanism during biomass pyrolysis is critical for the more efficient use of biomass and biochar. In this study, the effects of KOH/biomass ratios (1:8 to 1:1) and temperatures (400-800 ?C) on biomass pyrolysis were investigated. The KOH chemical activation mechanism was explored by revealing the evolution mechanisms of the gaseous product, bio-oil, biochar, and KOH, based on experiments and quantum calculations. Results showed that KOH can react with active O-containing species in biomass, which was the main reaction at lower ratios (1:8-1:2) or lower temperatures (400-600 degrees C). Here, KOH was completely transformed to K2CO3, leading to the formation of large amounts of gaseous products and phenols (reaching 75%). The reaction between KOH and more stable carbon fragments, however, was enhanced at higher ratios (>1:2) or higher temperatures (700-800 ?C), such that it became the main reaction. With a significant decrease in the phenols and O-species, the hydrocarbons became the dominant species (reaching a content of 57.43%). For biochar, the reactions among KOH, O-containing species, and carbon fragments generated an abundance of vacancies in the biochar. The OH- from KOH rapidly entered these vacancies, forming a large amount of new O-containing groups (i.e., C=O, -OH, C-O, O-C=O, and -COOH groups). This also caused an increase in oxygen content (reaching 23.68 wt%) in biochar. At higher temperatures, the reactions between KOH and biomass were significantly enhanced, along with a sharp increase in the specific surface area (reaching 1351.13 m(2)/g). O-containing groups further transformed to more stable -OH, C-O, and -COOH groups. Based on the evolution mechanism of pyrolytic products and KOH, the KOH chemical activation mechanism during biomass pyrolysis was revealed, allowing us, for the first time, to propose a possible chemical reaction pathway between KOH and O-containing groups.