AEG stands for airsoft electric gun. An AEG can be just about anything, pistols, assault rifles, DMRs, heavy weapons, CQC rifles, etc. While they design, appearance and shape of all these guns may change drastically, there are always common factors in the way they work.
How they work
AEGs are always powered by a battery. This battery can change drastically in power and efficiency but they always require a battery of some sort. This battery feeds electricity through two cables into a trigger assembly. Sometimes this trigger assembly varies, it can be a trigger contact, microswitch, or MOSFET aided, or MOSFET contacts.
Trigger contact is the most common, it consists of three disconnected metal pieces. The red wire is usually connected to one side and when the trigger is pulled, the contact trolley is slid forward bridging the space between the other two pieces. When they make contact, the electricity can flow from the side connected to the battery to the side connected to the motor activating the motor.
A microswitch operates in nearly the same way, only it is internally integrated into an assembly and typically last a little longer.
MOSFET aided is when a trigger contact or microswitch is aided by a MOFSET which allows for higher voltages without burning the contacts. One of the biggest problems with the electrical portion of airsoft is that the trigger assembly will eventually burn if you are using high powered batteries. Typically, contacts or microswitchs can only operate with no more than 10 volts. If you use a battery power higher than that, before the trigger will fully connect, the electricity will arch through the empty space and burn the contacts. This is solved with a MOSFET which is designed to redirect voltage around the trigger so you can use higher voltage batteries without burning your contacts.
The last trigger assembly is the MOSFET contacts. MOSFET contacts replace all contacts with a full MOSFET. Normally, microswitches can't be replaced fully with a MOSFET contact. Usually, only version 2 and 3 gearboxes can be replaced with MOSFET contacts because companies have to create different shapes and size MOSFET contacts for each gearbox type, so instead they mostly only make MOSFET contacts for the most popular two gearboxes: 2 and 3.
MOtors and gears
Motors are the next step in the process. When electricity passes through the trigger contacts, they reach the motor which spins the pinon gear at the tip of the motor shaft. There are three size motors: short, medium, and long.
From there, the pinon gear found on the end of the motor spins the bevel gear. The bevel gear in turn spins the spur gear which then spins the sector gear. The bevel gear has a angled side so that the motor can turn it but remain perpendicular to the gear set. The spur gear is wide flat gear that helps determine the gear ratio. The sector gear is a thicker gear with half of the teeth missing on one of the sets. This allows for movement of the piston.
Version 2 gearbox
The sector gears pickup side strikes the pistons pickup gear and starts to pull the piston back. The spring is located behind the piston which gets compressed with the piston so that it can push the piston forward. When the last of the sector gears teeth have passed the piston, the spring slides the piston forward. The piston compresses air located in the empty space in the cylinder which gets pushed out through the cylinder head.
AEGs have a variety of pros that other platforms can't claim to have
Internal power source
Cheaper to use than gas
Can be fired fully automatically
Significantly cheaper to buy than HPA or gas
Many parts are compatible
Usable in most weather conditions
AEGs are usually fantastic for beginners. People are usually best starting off playing with AEGs because they are cheap, easy to use, and easy to customize. Usually, people will start off with a lower end AEG, use it until it breaks then either get a more expensive one or switch to another platform such as gas or spring guns. They are also good for use in nearly any weather conditions. Excluding rain, they can generally be used all year round. Sometimes, players alter their guns to make them water tight so they can use them in the rain. The batteries generally don't last as long in the winter as they do in the summer, but they still function well.
AEGs also have a long list of cons
Can be slow to recharge batteries
Many parts, some can break easily
Expensive to upgrade fully
Some platforms are not compatible with upgrade parts
Performance can vary drastically
Time consuming to work on
AEG guns are difficult to work on due to the large number of parts. Most parts were listed here but some smaller ones were not, however they will be listed on the tech info pages as well as intricate explanations of how and why they work. Also due to the high number of parts is the expense. In order to fully adapt an AEG to your desired needs, you might need to replace nearly every part. If you decide to go with high end parts, you could be looking at an expense of $300-700. Low end AEGs can vary drastically in performance. One shot might fire at 400 fps and reach 200 feet, the next might only fire 380 fps and only reach 170 feet. Most of the time this inconsistency can be solved with higher quality BBs, sometimes, it is caused by poor compression seal.
AEGs are the most popular style guns due to their great pros for beginners when the cons might not be a problem. The cons can also be mitigated using high quality upgrades. AEGs can be very custom guns and very adaptable to most environmental conditions. You do not have to carry an external power source like you would with HPA. Upgrade parts can be easy to find, or hard depending on the gearbox design. For every person, the pros and cons should be weighed against each other to see if AEG is the right style for you.