DNA replicates itself in cell division via the polymerase chain reaction, which is also key to some DNA-computing architectures. Replication starts with the double helix unzipping itself by breaking the hydrogen bonds that keep the two strands together. As the two strands start to separate, the now un-bonded bases are free to bond to bases in other nucleotides.
So long as there are free nucleotides around, this is exactly what happens, but only nucleotides with the complementary bases can create new hydrogen bonds. So As and Ts attract each other, as do Cs and Gs and, in so doing, both strands of the original DNA bond to the nucleotides necessary to replace the missing complementary strand. In time, this process produces two DNA molecules identical to the original one.