Airsoft guns are frequently used to train soldiers and officers in the army and in law enforcement (respectively). Why is this? Well, airsoft guns are very similar to real guns used by these personnel, and in many cases, the size ratio and even weight ratio is 1: 1. Also, the devices function very closely to how real guns operate, at least, at a privileged level. Of course when it comes down to internal functioning, a real gun will have the proper pins and such in order to ignite gunpowder inside ammunition, while airsoft guns have no shells and are planned by a spring or gas. And unlike what many people may have told you, it's the outside that counts (at least, in airsoft).
One of the main reasons airsoft guns are so attractive in militaristic simulations is, along the realism, the simple fact that you can actually use them to fight. All you can do with a real gun is target shoot or, at most, fire blanks at people, but nothing that comes close to real. Personnel can actually engage in realistic military operations with airsoft guns, and perform maneuvers that they may well do in actual combat. The training is very efficient because of the size and weight ratios, and the fact that, with the use of the appropriate airsoft guns, the training sounds like a real battle.
The alternative to airsoft guns, paintball guns, have also been used in training. The problem with using paintball guns is that it is much harder to feel like it is real. There are many reasons for this, the most being that the gun does not feel real. You have a large CO2 container bulging out from the back, and a hopper right in your face. Another important thing is that clips are not used in paintball, except for occasionally being incorporated into paintball pistols. Pouring paintballs into a hopper does not feel realistic at all. In airsoft, you reload clips like you would with a real gun. On to the size of the ammunition; airsoft pellets are closer to the size of bullets, while paintballs are big, and in many cases you can see them coming. It is definitely harder to see plastic BBs, especially when they are dark.
Military simulations utilize airsoft guns more than law enforcement simulations, as police officers do not routinely use machine guns. While many cops may use the products for recreational use, they are not regularly sanctioned for training. The statistics for airsoft use within SWAT is most likely higher than that of regular police officers, but it is certain that the military incorporated airsoft guns more than any other agency.
The fact that airsoft is becoming so involved with the military is one of the reasons that airsoft guns are becoming more advanced. It is no secret that there are certain flaws with airsoft guns, and "airsoft scientists", so to speak, are thinking up ways to make airsoft guns more realistic, save for the deadliness.