DNA restriction is a system that is found in prokaryotes such as bacteria, and they are particularly valuable in molecular biology and genetic engineering because they prohibit foreign DNA from being introduced.
A bacterial cell uses a restriction enzyme to cut the virus's invading DNA at the enzyme's specific recognition site. This stops the virus from using the cellular metabolism to replicate itself. This process is known as DNA restriction.
DNA modification:
DNA modification system is also found in prokaryotes like bacteria, but this system helps them to protect their DNA from cleavage by a restriction enzyme that is produced to cut the virus's DNA that has attacked a bacterial cell.
The host bacterial cell protects its DNA by a modification enzyme called methyltransferase that modifies the bacterial DNA and blocks cleavage by a restriction enzyme.
This methyltransferase enzyme methylates certain bases (recognition site for restriction enzyme) within DNA sequences. These bases are then not recognized by the restriction enzymes and thus escape from cleavage.