The DndABCDE systems catalysing the unusual phosphorothioate (PT) DNA backbone modification, and the DndFGH systems, which restrict invasive DNA, have enigmatic and paradoxical features. Using comparative genomics and sequence-structure analyses, we show that the DndABCDE module is commonly functionally decoupled from the DndFGH module. However, the modification gene-neighborhoods encode other nucleases, potentially acting as the actual restriction components or suicide effectors limiting propagation of the selfish elements. The modification module's core consists of a coevolving gene-pair encoding the DNA-scanning apparatus – a DndD/CxC-clade ABC ATPase and DndE with two ribbon-helix-helix (MetJ/Arc) DNA-binding domains. Diversification of DndE’s DNA-binding interface suggests a multiplicity of target specificities. Additionally, many systems feature DNA cytosine methylase genes instead of PT modification, indicating the DndDE core can recruit other nucleobase modifications. We show that DndFGH is a distinct counter-invader system with several previously uncharacterized domains, including a nucleotide kinase. These likely trigger its restriction endonuclease domain in response to multiple stimuli, like nucleotides, while blocking protective modifications by invader methylases. Remarkably, different DndH variants contain a HerA/FtsK ATPase domain acquired from multiple sources, including cellular genome-segregation systems and mobile elements. Thus, we uncovered novel HerA/FtsK-dependent defense systems that might intercept invasive DNA during replication, conjugation, or packaging.