Mags operate as 'blow forward' markers. Rather than have a spring push the bolt forward to fire and gas force it back to re-cock, gas forces the bolt forward and a spring re-cocks it.
There's two different types of Mag valves - the classic A.I.R (as fitted to the 68 Automag, Classic, Minimag etc) and the RT/ReTro valve which is used in RT, RT Pro, E-Mag. There's also the X-Valve which is basically a ReTro made of ally rather than stainless.
The classic valve works like this:
Your air source is connected into the rear of the valve which acts as a regulator (which is why mags don't need secondary regs, just the bottle reg).
The gas flows from there into an air resevoir which is located behind the bolt - the bolt acts as a 'cork', preventing the gas from escaping down the barrel.
When the air pressure becomes high enough to overcome the force of the regulator spring/piston, the reg pin closes onto the reg seat to close the air supply (by dialling the reg up/down you alter the pressure in the reg and thus alter the velocity).
Pulling the trigger makes the trigger sear rock, which does two things - the rear of the sear moves upwards and closes the on/off valve which sits between the regulator and the air resevoir (this means that there is now a precise amount of gas at the set pressure sitting behind the bolt). The front of the sear (which hooks onto the bolt) drops, releasing the bolt - which (in the same way as the cork in a bottle of champagne) is forced forwards by the gas in the resevoir.
The front of the bolt pushes a paintball into the barrel and then the inner-stem of the bolt 'pops' clear of the power tube o-ring, allowing the gas from the resevoir to flow through it and fire the ball.
Once the gas pressure behind the bolt has dropped sufficiently, the main spring forces the bolt backwards and recocks the marker.
Releasing the trigger allows the sear to re-grip the bolt and allows the on/off pin to be forced downwards, allowing gas to flow through the on/off into the resevoir again.
The RT valve works in a similar manner - but whereas in the classic the pressure on the on/off pin is equal to the regulated pressure inside the valve, in the RT it is actually the unregulated pressure from your air system - which means that the on/off pin kicks the trigger back after firing with more pressure behind it.
The RT also recharges faster - but I'm slightly hazy about how that works, something to do with a greater pressure differential between the reg and resevoir....
The E-mag works in just the same way as the mechanical mags, execpt that in 'E' mode pulling the trigger (which has magnets inside it) trips a magnetic (hall effect) sensor and actuates a solenoid that pulls on the sear, firing the marker.