Function of the AGR

Hello I have a 306 xrd wretch. because my agr (gas return valve) was defective and my engine did not have any power and I smoked nicely. But until now nobody could tell me for what I actually had the agr in my car. After the exchange I had the same effect zero power and the car smoked, so I plugged off the agr and the car goes back super full power and no longer smokes. what the reason is we I don’t eat but villeicht knows someone what but that’s not the real question. My question is why do I have an agr and what exactly does it do???