A turbocharger compresses the air going into the engine in order to force more air than would be possible with the atmospheric pressure. More air into the engine means automatically more fuel has to be injected in order to maintain the appropriate stoichiometric value of the air/fuel ratio (around 14:1). More air and fuel into the engine leads to more power. However, by compressing the inlet air the turbocharger also heats it. Higher air temperatures lead to thinner air and therefore an altered stoichiometric ratio which can lead to a lean mixture and detonation (knocking or pinging, which in severe cases can damage an engine).
In high-pressure turbocharged engines the air/fuel mixture that enters the cylinders can, in some cases, explode prematurely (before the spark plug ignites) due to the extreme engine environment conditions. This situation is extremely destructive and results in severe engine damage (piston piercing). To avoid damaging the engine by detonation or pre-ignition phenomena, water is injected, along with fuel, into the combustion chambers in order to provide a water/air/fuel mixture which not only burns more efficiently and avoids detonation or pre-ignition but also provides additional inlet air cooling and, hence, denser air. The water can be added at several different points along the intake path, but it performs the same function regardless of where it's added.