The gain expansion is mostly due to the non-linear transconductance(gm) of the transistor. Ideally, gm is constant, so class A and class B are linear amplifiers, while class AB doesn't. In small signal region, class AB operates as class A, full wave amplification, while in the very large signal region, the performance is close to class B. As we know, the difference of gain between class A and B is 6 dB. So the gain of class AB amplifier should decrease with an increasing input power in the ideal case. However in our real world, the gm is, more or less, a bell-shaped curve referring to the input power. So gain expansion appears. This effect can be compensated by adjusting the conduction angle, which is controlled by the bias point. In this way, sometimes, class AB might be a linear configuration.