How, from a physical standpoint, does keg lube help a gasket to seal better on a keg?
Silicone spray or gels actually absorb into the seal expanding it slightly and helps it slip into place. Overuse can cause the diameter to expand too much to where it won't seal. Use of the wrong lubricant can degrade the o-ring, turning it to a black slime.
If your keg needs more than light spray of a food grade silicone spray to aid it, the o-ring needs to be replaced.
I assume you're using the same type of lube i do on my kegs: a white translucent food grade mineral oil gel, not dissimilar to vaseline.
The lube allows the o-rings to move against the keg and fittings, but remain in the correct location to create a seal. Without lube, i have trouble getting the lid to slide into place. Lube allows the fittings to glide over the rubber material of the seals. Without the lube, the o-rings may flex out of their grooves, or prevent the lid or gas/liquid lines from fully seating.
I have never gotten my fill lid to seal without using lube; it's possible the lube fills in areas around or between the o-ring and/or fitting, that would otherwise allow passage of gas or liquid. More likely, it allows slight movement of the large o-ring, preventing it from twisting or deforming in ways that would fail to seal.
The lubrication on a gasket is there to ensure that as forces are applied to the gasket or seal in a non-uniform manner the seal can slip a little to help prevent distorting and tearing which will affect the integrity of the gasket long term and may impair the quality of the seal formed.
Depending on the material your O-ring is made from will affect what lubricant you use. In 99% of circumstances you can not go wrong with silicone. But, I have in the past used Vaseline, olive oil, vegetable oil, if you don't have silicone grease to hand, a light vegetable oil or vasaline will work, but they may react with the seal if it is rubber. If the seal itself is made of silicone then you are fine using most any lubricant so long as it is food safe.