Corn, Potatoes, or even wheat is fermented.
Then, the alcohol is separated from the resulting mixture, distilled a few times, and tested for quality.
The goal is to get as much alcohol per volume as possible, 120 proof and up are common for moonshine.
However, if the starting fermentation isn't done correctly, harmful acids such as, ethyl acetate can form in the mixture. It is similar to acetic acid which is used in nail polish, manufacturing, etc.
If ethyl acetate is ingested in large quantities it can cause blindness, organ failure, or even death.
Making moonshine is actually illegal in most states for a few reasons.
First, during distillation there is the chance that the alcohol will react with the heat generated. This reaction would cause the alcohol to combust, resulting in an explosion.
Second, it is illegal because it is not taxable.