NaCl provides Na+ ions that will block the negative charge from phosphates on DNA.
Negatively charged phosphates on DNA cause molecules to repel each other. The Na+ ions will form an ionic bond with the negatively charged phosphates on the DNA, neutralizing the negative charges and allowing the DNA molecules to come together