In general, if you purchase non-prescription sunglasses from a quality provider you will most likely get a good product. If you buy them from the booth on the sidewalk at the beach, all bets are off. Good quality non-prescription sunglasses are made the same way as prescription eyeglasses. The lenses are optically ground. The difference is that they are ground to have zero prescription. The front and back surfaces exactly match one another. This creates a lens that allows light to pass directly through it without bending. Significant research goes into the determination of the tint in the lenses. The lenses can be polarized as well which does a great job of eliminating reflected glare from horizontal surfaces. This is helpful when on the water or skiing of after rainy days. Lenses that have a yellow color or amber color are noted to enhance contrast. This can be helpful of outdoor activities like shooting and skiing.
So how do you tell if the lenses are ground properly? Turn the sunglasses over and look for a reflection from the back surface of the lens. You can look at a reflection from a horizontal light tube or the edge of a light source. Move the lens so you can follow the reflection. If the reflection does not "wobble" or seem to become irregular as you move the lens, this indicates that the surface has been optically ground. There is another way to demonstrate the optical properties of the lens. Light can be projected through the lens at a doctor's office. The images projected through the lens should be clear and well defined. If not, this can indicate optical distortion.
Lenses can be treated to block UV but still may not be optically ground. Ideally the lenses should both be treated to block UV and be optically ground.