dBm is an abbreviation for the power ratio in decibel (d

of the measured power referenced to one milliwatt (mW)

The antenna is compared to a mathematical ideal, the isotropic antenna. (Isotropic - equal in all directions). For an ideal isotropic antenna, radiation is distributed uniformly on the surface of a sphere of radius surrounding the antenna.

The gain is referenced to an isotropic antenna. If we compare power density, for the same transmit power and the same range dBi will be 10log10 received power of directional antenna / received power from isotropic antenna.