How does bacteria protect their own DNA against restriction enzymes?
Through methylation of their own DNA.
This is a fascinating example of how evolution works! The restriction enzymes in bacteria function to defend themselves against invading viruses (bacteriophages). The DNA sequence the restriction enzymes recognize are present in the viral DNA but also in the DNA of the bacteria itself.
Bacteria prevent eating away their own DNA by masking the restriction sites with methyl groups (