To investigate the effects of substituting Ag and Sb for Pb on the thermoelectric properties of PbTe, the electronic structures of PbTe and AgPb18SbTe20 were calculated by using the linearized augmented plane wave based on the density-functional theory of the first principles. By comparing the differences in the band structure, the partial density of states (PDOS), the scanning transmission microscope, and the electron density difference for PbTe and AgPb18SbTe20, we explained the reason from the aspect of electronic structures why the thermoelectric properties of AgPb18SbTe20 could be improved significantly. Our results suggest that the excellent thermoelectric properties of AgPb18SbTe20 should be attributed in part to the narrowing of its band gap, band structure anisotropy, the much extrema and large DOS near Fermi energy, as well as the large effective mass of electrons. Moreover, the complex bonding behaviors for which the strong bonds and the weak bonds are coexisted, and the electrovalence and covalence of Pb–Te bond are mixed should also play an important role in the enhancement of the thermoelectric properties of the AgPb18SbTe20.