In a spring operated gun the user is required to compress the spring each time before a shot can be fired. When the trigger is pulled the compressed spring is released and a piston forces air forward to fire the BB. Bolt action rifles commonly use this method.
In an AEG its the same principal except now the spring is compressed mechanically with motor drivin gears. The bonus to this method is that automatic and burst fire can be achieved easily.
In a gas based gun, gas and BBs are stored in the magazine of the gas gun and when the trigger is pulled a valve is engaged which releases gas which is channeled to propel the BB down the barrel.
"Its only a little bit on fire"