Biogenic coalbed methane (CBM), generated through the biodegradation process of coal organic matter, is a relatively clean and environment-friendly unconventional natural gas resource. To investigate the differences in microbial communities (bacteria and archaea) as well as their environmental influencing factors between the Permian Shanxi Formation (P1s) and Taiyuan Formation (P1t), we systematically collected in-situ CBM samples along with coalbed water and microbial samples from a representative biogenic CBM field – the Baode block locked in the Ordos basin in China. The relative content of biogenic CBM was quantitatively calculated while analyzing gas composition, stable isotope, ion content, and high-throughput sequencing analysis to discuss the generation pathway for biogenic CBM and environmental control factors affecting microbial community structure. The results indicate that P1s and P1t are mixed with early thermogenic gas and secondary biogenic gas genetic types within their respective CBMs. The average proportion for biogenic gas within current coal seams is approximately 62.24 % for P1s, while it reaches around 64.37 % for P1t. Water quality type primarily consists of Na-HCO3 type with total dissolved solids (TDS) measuring at approximately 1015.86 mg/L for P1s, whereas P1t exhibits Na-Ca-HCO3-Cl water type with TDS content reaching about 2314.85 mg/L. Combining dominant Methanobacterium species, along with Δ13C(CO2-CH4) ratios and δD(CH4) versus δD(H2O) indexes, represents the biogenic CBM primarily generated through the hydrogenotrophic methanogenesis pathway. The in-situ bacterial communities of P1s are mainly influenced by Ni, pH, and TDS. The archaeal communities exhibit higher sensitivity to environmental factors (such as Co, pH, Ni, and dissolved organic carbon) than bacteria. These findings hold significant implications for understanding the generation process of biogenic CBM in middle and low-rank coal areas.