Same thing it does to the paint. Gets out the contaminants that don't come off in normal washing. I only do the windshield. That way when the sun hits it or at night under the streetlights visibility is good.
Typically you can use detailer spray or car wash soap. Essentially anything that is lubricity. Last thing you want is for the claybar to not glide smoothly. That is where you will fall into issues. Lastly, I would wash the entire windshield once more after you are done so you can ensure all the stuff is off the windshield.