6" is the minimum depth normally required to get a zone without oxygen ('anoxic'), with your average sized grain sand and typical flow. At 4" or so, you'll get a 'hypoxic' (low oxygen) zone, and *some* denitrification can happen there, but not much.
Think of it like a layered cake. From 0-4", you'll have a lot of pods, worms, and aerobic bacteria (oxygen loving). From 4-6" you'll have mostly aerobic bacteria that are very good at converting ammonia and nitrite to nitrate, with some anaerobic bacteria at the very bottom. From 6" on down, you'll have anaerobic bacteria that work without oxygen, converting nitrate to nitrogen gas.