The alcohol (ethanol or isopropyl) is a a solution that the DNA is not soluble, because of that the DNA that is need for the experiment precipitate with the addition of alcohol, when the DNA precipitate comes out of solution it will clump together and make possible to visualize it in the sample.