Firstly, what is the difference? Basically they are both more similar than different, but the differences are important. They both divert a small percentage of propellant gas out from the barrel to force the bolt carrier back, thus enabling the firing cycle to continue. The difference is where the gas does its work. With direct impingement, the gas travels into the gas block and down the tube to directly hit (or “impinge”) on the bolt carrier. It is simple and effective. The downside is hot gas and carbon is going back into the working parts of the rifle. (Note: Some people prefer not to refer to the system as direct impingement, stating that Eugene Stoner called it an "expanding gas system", and it in fact acts more like a piston system. While good points, for the sake of explanation simplicity I will continue to use the term DI).
Gas piston uses the same technique, however rather than the gas pushing directly on the bolt carrier group, it pushes on a rod that then in turn pushes on the bolt carrier group. It is still simple, but requires a few more parts, like the rod to push bolt carrier. Some companies use a spring to help return it to where it will receive gas. The advantage of the gas piston is that the gases can come out away from the working parts. They leave the gas block, hit the piston and vent right there. Heating and dirtying up exterior parts, rather than your rifles internals. There are some differences between gas piston brands, but the concept is the same for each.
Short answer? Buy a DI if you are worried about zombies (part interchangeability), or long range slow fire accuracy (see below). If you don’t care about that, but you do care about how long it takes to clean your rifle, worry about the carbon build up or you just like the look of them, then get a gas piston. A good rifle with either gas system is extremely reliable.
Long answer? Read on…
Around the time H&K was pushing the 416 on the military a lot of propaganda came out slamming the DI system. Much of it focused on so called reliability issues. It offended me on many levels that the DI system was touted as unreliable. A milspec DI system, with even an OK level of maintenance will still run every mag a soldier can carry and then many, many more. Sand, dust or dirt, you can keep them running. But, there is no doubt that gas piston systems run cleaner - for a small weight increase. Gas piston stress tests claim they overwhelm DI. Published tests like the Filthy 14 and Mike Pannone's test offer an excellent counterpoint that DI is just as reliable.
I ran my own tests and I don’t see a reliability issue with either over any conceivable amount of ammo a guy is going to run. If you can’t throw some oil on your weapon after 50+ mags then you are in a serious, serious firefight and overheating is more likely to be your issue than anything else.
Yes, there are a couple. A couple more parts means theoretically more parts that could fail. Along that line, you also have the part supply and interchangeability issue. Gas piston parts generally speaking, are not able to be swapped from brand to brand: A PWS bolt carrier won’t work in an LWRCI or visa versa. So if the zombies come your chances of getting gas piston replacement parts are lower.
Another negative to the gas piston system was reported to me by several buddies that run a lot of 3 gun matches. They said that they went back to DI because gas piston was slower to reset. I struggled with that from a logical standpoint but I trust the guys who told me. Given that the gasses now need to push the BCG, plus a rod (and maybe a smaller spring) against the buffer and spring, I can see that while it is only a small addition in weight, the added mass of the rod could slow the process down by a tiny amount. Maybe enough to be noticeably slower to a shooter that measures his times in hundredths of a second. But of course by that argument, simply having some carbon build up can reduce the useful internal diameter of the gas tube could slow down any rifle, piston or otherwise, and it is more likely to occur in a DI. More simply an added weight can be countered with comparatively lighter buffer or even a stronger return spring. It is all a question of tuning your gun. A well tuned gun from any category should be able run faster than a badly tuned gun from the other.
Perhaps the biggest issue against a gas system is the reported loss of accuracy from a gas piston system. Gas piston systems indeed put more weight/support (and therefore stress on a barrel). Some report no loss of accuracy, others say it is huge. For me there seems to be a little. I strongly believe that a loss of accuracy is real. There are 2 reasons for this. The least significant of the 2 is the fact that gas piston rifles are less free floating. Different positions will stress the barrel (slightly) in different ways.
But the main reason for the lessened accuracy is due to the shooter. Gas pistons are harder to fire accurately for the same reason any semi automatic rifle is harder to fire as accurately as a bolt rifle - controlling the rifle while the internal ballistics are taking place is harder when more parts are moving inside. Gas piston rifles begin to work on unlocking the bolt moving the carrier back sooner than DI rifles. That means more movement in the rifle that needs to be controlled by the shooter. A great shooter with solid fundamentals and a good position should not notice the difference, but most people will be affected to a certain degree by it.