Fogging is a Physical phenomena. If you apply a steam (100% humidity, 99F air, i.e., you breath) onto a cold surface (82F glass lens), that steam is going to condense, i.e., fogging on the lens.
Water has a very high surface tension (72 dyne/cm). It will form tiny beads (fogs) on a clean glass surface, when steam condenses on the cold glass surface.
Surfactant, like baby shampoo, coating on the glass, would lower the water surface tension when steam condenses on the glass. The condensate would spread to form a thin water film on the glass, hence, no fogging issue. Unfortunately, the water film also would slowly dissolve & wash away the surfactant (baby shampoo). Pretty soon the glass would be free of surfactant & fogging begins.
So, try to keep the inside mask dry while diving (by keeping the seal tight, minimizing mask flushing & not exhaling through the nose) if you don’t want to fog up the lens.