An electronic airsoft gun must contain a battery of some sort. Often, the battery is rechargeable. The battery is there to move the gears. The gears are there to pull back the bolt against a firing spring. The trigger and barrel allow the pellet to fire timely and accurately.
The Firing Process
The battery is directly connected to the small electric motor. The motor is equipped with three plastic gear sprockets that compress the bolt up against a spring. Once the bolt is fully compressed against the spring, the user pulls the trigger. The trigger sends a signal for the gears to release and allows the spring to fire the bolt forward at a fast rate. While the bolt is back, air gets trapped between the bolt and the pellet. When the bolt releases, a tremendous amount of air pressure builds up behind the pellet, firing it out of the barrel with a velocity that can be set from 150 to 500 feet per second.