@Countryboyjvd1971- After the larva morphs into the adult gnat, it must get to the surface to complete its life cycle. The fine sand acts as a barrier to confine the fly to the soil/medium. So it can't finish the cycle and lay more eggs. Essentially it's smothering the adult gnat.
You can water right through the sand. Just make sure to cover any spots free of sand. j
They can get out of control easily. So keep an eye on it. They lay hundreds of eggs every other day. The larva will eat your mycorrhizae and new root growth, basically starving your plants... but It'll appear as necrotic leaves/nute lock out.
Nematodes are a great amendment to your soil/medium as well. They roam through the soil eating every larva they can find... and that puts a smile on my face. Lol!