Gain can mean different things according to what is being compared to what, thus a few preliminary words are called for.
In professional circles the base antenna for comparison with is a theoretical isotropic radiator, an antenna that radiates uniformly in all directions of space. However, perfect omnidirectionality in three-dimensional space can never be achieved. Nevertheless, the concept of such an ideal radiator is most useful for theoretical purposes. The power gain of an antenna in a given direction is expressed in decibels relative to an isotrope, and in this context is referred to as so many dBi.
In amateur circles a more pragmatic approach is usually taken, and the base antenna for comparison with is usually a half wave dipole. In this context the power gain in a given direction is referred to as so many dBd. It is generally accepted that the power gain of a half wave dipole over an isotrope is of the order of 2.15dB, so a gain of 12.15dBi is the same as a gain of 10dBd.
However, the distinction must be made between a comparison on the basis of the power input to the antenna to that of an isotrope, and that made on the basis of the power radiated by the antenna to that of an isotrope.
If we are comparing on the basis of input power the term power gain is used, whereas if we are comparing using radiated power the term directive gain is used. The difference is that power gain takes into account the efficiency of the antenna as well as its directional properties.
There is a relationship between power gain and directive gain, the efficiency factor k, which is the ratio of the power radiated to the total input power. It is a number between 0 and 1, where 0 is totally inefficient and 1 is totally efficient. Thus the relationship between directive gain D and power gain G is:
G = kD
If the antenna has no ohmic losses and therefore radiates all of the power delivered to is then k = 1 and G = D i.e. the power gain and directive gain are equal.
PolarPlot measures the relative field strength E of signals delivered to the receiver and calculates relative power from these readings. The input power and antenna efficiency are not known by the program, and all estimates of gain are Directive Gain relative to an isotropic radiator i.e.. dBi.
The Directive Gain of the antenna is estimated in two ways: by measuring the half power beamwidth of the antenna, and by integration of the whole pattern's readings. The results are shown in dBi.
As well as other factors the gain of an antenna is principally a function of horizontal and vertical beamwidth. Because the program is not aware of the full details of the antenna design, e.g. stacked array, quad, simple Yagi, element spacing etc and is simply reading the level of received signal of a given polarity, it can only provide an indication of gain.
Nevertheless, comparison of several plots of the same antenna before and after changes are valid and can be useful in determining whether changes to design, operating height etc have had the desired effect. However, unless you have precise before and after measurements and can accurately determine input power, you will not see the power gain changes resulting from modifications to the feeder system (assuming the feeder is not an integral part of the radiating system!).
For its calculations the program uses particular ratios between the horizontal and vertical beamwidths based on the number of elements. The difference between horizontal and vertical beamwidth is usually greatest with a 2 element beam, and decreases as the number of elements increases. When the number of elements is greater than 8 both beamwidths are, for practical purposes, the same.
The ratios used have been determined by reviewing the EZNEC results of a number of antenna designs. A Yagi designed for optimum front/back ratio and a clean pattern will show a reading close to reality, but an antenna designed for maximum forward gain resulting in a pattern full of side and rear lobes will yield optimistic readings.