The anti-PD-L1 monoclonal antibody (mAb) targeting PD-1/PD-L1 immune checkpoint has achieved outstanding results in clinical application and has become one of the most popular anti-cancer drugs. The mechanism of molecular recognition and inhibition of PD-L1 mAbs is not yet clear, which hinders the subsequent antibody design and modification. In this work, the trajectories of PD-1/PD-L1 and nanobody/PD-L1 complexes were obtained via comparative molecular dynamics simulations. Then, a series of physicochemical parameters including hydrogen bond, dihedral angle distribution, pKa value and binding free energy, and so forth, were all comparatively analyzed to investigate the recognition difference between PD-L1 and PD-1 and nanobody. Both LR113 (the amino acid residues in PD-L1 are represented by the lower left sign of L) and LR125 residues of PD-L1 undergo significant conformational change after association with mAbs, which dominates a strong electrostatic interaction. Solvation effect analysis revealed that solvent-water enhanced molecular recognition between PD-L1 and nanobody. By combining the analyses of the time-dependent root mean squared fluctuation (RMSF), free energy landscape, clustering and energy decomposition, the potential inhibition mechanism was proposed that the nanobody competitively and specifically bound to the β-sheet groups of PD-L1, reduced the PD-L1’s flexibility and finally blocked the formation of PD-1/PD-L1 complex. Based on the simulation results, site-directed mutagenesis of ND99 (the amino acid residues in Nano are displayed by the lower left sign of N) and NQ116 in the nanobody may be beneficial for improving antibody activity. This work offers some structural guidance for the design and modification of anticancer mAbs based on the structure of the PD-1/PD-L1 complex.