The use of modified biochar for the remediation of heavy metal (HM) has received much attention. However, the immobilization mechanism of biochar to multiple HMs and the interaction of different forms of HMs with microorganisms are still unclear. K2HPO4-modified biochar (PBC) was produced and used in a 90-days immobilization experiment with soil collected from a typic lead-zinc (Pb–Zn) mining soil. Incubation experiments showed that PBC enhanced the transformation of Cd, Pb, Zn and Cu from exchangeable (Ex-) and/or carbonate-bound forms (Car-) to organic matter-bound (Or-) and/or residual forms (Re-). After scanning electron microscopy-energy dispersive X-ray spectrometer (SEM-EDS), X-ray diffractometry (XRD), fourier transform infrared (FTIR), thermogravimetric analysis (TGA) and X-ray photoelectron spectroscopy (XPS) analysis, the mechanisms of HM immobilization by PBC were proposed as precipitation (PO43-, HPO42-, OH- and CO32-), electrostatic attraction, complexation (–COOH, –OH and R–O–H) and the indirect roles of soil parameter variations (pH, moisture and microbial community). Microbial community analysis through high-throughput sequencing showed that PBC reduced bacterial and fungal abundance. However, addition of PBC increased the relative proportions of Proteobacteria by 15.04%–42.99%, Actinobacteria by 4.74%–22.04%, Firmicutes by 0.76%–23.35%, Bacteroidota by 0.16%–12.34%, Mortierellomycota by 4.00%–9.66% and Chytridiomycota by 0.10%–13.7%. Ex-Cd/Pb/Zn, Car-Cd/Zn and Re–Cd/Pb/As were significantly positively (0.001<P≤0.05) correlated with bacterial phyla of Crenarchaeota and Methylomirabilota, and Re–Cu and Ex-/Car-/Fe–Mn oxide-bound (Fe–Mn-)/Or-As were significantly positively correlated (0.001<P≤0.05) with the bacterial phyla of Proteobacteria and Bacteroidota. While Car-Cd/Zn and Re–Pb/As were positively correlated (0.01<P≤0.05) with fungal phyla of Ascomycota, Glomeromycota, Kickxellomycota, Basidiomycota and Mucoromycota. The bacterial network contained more complex interactions than the fungal network, suggesting that bacteria play a larger role in HMs transformation processes. The results indicate that PBC is an effective agent for the remediation of HMs polluted soil in Pb–Zn mining areas.