When a gas operated weapon is fired, the cartridge generates hot gases, which push the bullet out of the barrel. Most of the gas also leaves the barrel behind the bullet, but a portion of the gases are tapped out and used to operate the extraction and reloading mechanism, to eject the old cartridge and load a new one.
The basic idea behind a short stroke piston mechanism is that when the cartridge is fired, some of the expanding gases are tapped by a port close to the firing point or the middle of the barrel. This means that the gas here is at relatively high pressure (compared to if the gas was tapped close to the open end of the barrel). This high pressure gas is then allowed to act upon a piston. The other end of the piston touches the bolt carrier of the rifle. When high pressure gas acts upon the piston face, it pushes the piston back very rapidly, which in turn pushes the bolt carrier back. The piston moves back for a very short distance (generally, a distance that is less than its own diameter) and is then abruptly stopped, either by a projection, or by a gas cut-off. The bolt carrier separates from the piston and continues to move back on its own, due to the kinetic energy imparted to it by the piston. The bolt carrier drags the bolt backwards, which extracts the fired cartridge out and ejects it via a side port. They continue moving backwards and cock the rifle again, ready to fire. When the bolt carrier reaches its most backward position, a return spring pushes it forward again. On its way forward, the bolt picks up a new cartridge from the magazine and pushes it into the firing chamber. As it reaches its forward most position, the bolt locks and the weapon is ready to fire again.
The animation above shows the mechanism of the LWRC short stroke piston mechanism. It only shows the movement of the piston and not the bolt-carrier or bolt, but you can get a good idea of how it works. Note how the hot gases are vented out close to the middle of the rifle.
There are some advantages of the short stroke piston system. Like all gas-operated piston systems, the hot gases only impinge on one side of the piston and the other end of the piston rod pushes the rest of the mechanism. This means that all the hot gases and carbon residue are kept away from the rest of the operating mechanism, which improves reliability and life of the operating parts. Also, since the piston is stopped very quickly, the total mass of recoiling parts is smaller and therefore this makes the weapon easier to control. The other advantage is that shorter barrels can be used with short stroke piston systems.