The Exhaust Gas Recirculation valve lets exhaust gas back into the intake manifold. This reduces peak cylinder temperatures to reduce oxides of nitrogen which causes smog. It also allows more ignition timing advance to be run because it slows down the burning process.
Without EGR it may not pass emissions tests and the engine will ping or knock at moderate throttle.
The problem you are having is caused either by a leaking EGR control solenoid, or a bad DPFE (differential pressure feedback EGR sensor).
If pinging is occuring, run higher octane gas untill you get it fixed.