Biochar (BC) adsorption has been widely acknowledged as an efficient approach for the removal of antibiotics. Despite the importance of oxygen-containing functional groups for the antibiotics removal, most of these may be obtained in BC only relying on the addition of oxidants. Herein, an environmentally friendly and oxygen-enriched functional groups adsorbent, namely Chlamydomonas BC (CBC), was fabricated via simple pyrolysis process. Then, the H-bonding, electron donor-acceptor and electrostatic attraction were identified as the main mechanisms regarding sulfathiazole (STZ) adsorption (506.38 mg/g). The carbon-oxygen functional groups on the surface of CBC (61%), especially -COOH and -OH, acted as a pivotal component. Additionally, further theoretical calculation led to the observation that STZ exhibited the highest chemical reactivity (η = 0.04), strong electron exchange capacity (μ = -0.16), remarkable electron accepting capacity (ω = 0.28) and excellent electron transfer efficiency (EHOMO-ELUMO gap = 0.29) under the influence of thiazolyl. The electrophilic sulfonamide group and the nucleophilic thiazole were identified as the main active sites of STZ. In summary, the results of this research provide a guiding role for the preparation of adsorbents driven by the structural characteristics of pollutants.