I agree with DragonCommando that the engine braking in petrol engine is due to vacuum created by closed butterfly valve, but still i have a doubt...I was coasting downhill with high rpm and felt high engine braking as soon as released my foot from the throttle, then i switched off the ignition and pressed the throttle wide open hoping that the engine braking will vanish because now there is no restriction to the intake valve and thus no vacuum is created....but to my surprise there was no difference in engine braking with closed or open throttle (with ignition off)....and my car accelerator does not have throttle by wire, it has direct mechanical linkage by wire to the butterfly, so i am confident that on pressing the accelerator the valve did open but engine braking was same as with closed throttle. I tried the same experiment many times and got the same result.
It will be appreciated if DragonCommando can explain why this is happening because the engine braking should reduce on opening the throttle with ignition off to my understanding of the concept.