Exploding barrels seemed to have always been present as an effective way to take down enemies quickly in video games. Often times, explosive barrels are found in shooters and placed suspiciously close to groups of enemies. This is essentially the game telling you "shoot this barrel to save ammo". Explosive barrels are usually identified as red or yellow so players can easily determine which barrels can take out that group of enemies, and which ones might just land on the enemy's toe. Of course developers know that barrels can get old or seem out of place in certain games and so they replace them with things like propane tanks and other such things.
Explosive barrels also vary between games in how they explode. Some barrels will immediately explode upon being fired upon, while others may have a sort of "timed" sequence where a tiny jet of flame is emitted from the barrel indicating that it will soon explode. Sometimes if you keep shooting at it, it'll shorten the timed sequence. Video games have never really made it clear what is in these red barrels, just that they explode. In certain games like Just Cause 2 blowing up barrels will win you points! Also exploding barrels can find other purposes than just killing dudes. They can be used to blow up a wall and are even sometimes used in puzzles.
Exploding barrels have evolved over the years, from a simple white puff 'explosion' to a lightning or acid explosion. See Borderlands, but with the difficulty of games being increased sometimes a good ol' Red Barrel won't do much...