I know that EDTA chelates metal ions. It weakens bacterial cell wall and inactivates the DNases.
What is the reason why it can do so ? I guess it can inactivate DNases by altering the microenvironment. What exactly happens ?
The lipopolysaccharide layer of the Gram-negative bacterial cell wall is stabilised by divalent cations. Most recipes for disrupting E. coli cells include Tris-EDTA for this reason. I seem to just know this, so no reference at the moment.
All nucleases require Mg2+, which is why there is EDTA in the stop buffer added to restriction digests. Carry-over of EDTA in DNA pellets can sometimes inhibit digests.
A lot of enzymes need metal ion in their active center (it is actually the metal ion which is taking part in the catalyzed reaction). These are manganese, magnesium, copper and so on. For DNAses the metal in the active center is magnesium and EDTA simply chelates this ions, making them unavailable for the enzyme and thus hinders the enzyme from working.
The 3d structure while chelating a metal ions like this:
You can see, that the metal ion is nicely located between the negatively charged oxygen atoms and the nitrogen atoms. These complexes are fairly stable and the metal ions do not escape.