I admit that I know very little about UV sterilization, but fortuitously there just happens to be an article on this very subject in this month's TFH, authored by Valerio Zupo who is a professional lab technician who has written several scientific papers for international journals on the subject. The following information may give us a better understanding; what follows is direct citation or paraphrasing of the article.
UV radiation is dangerous to all living things, being able to cause mutations in DNA. UV rays contain a very high amount of energy and can penetrate cells, reaching the DNA where they cut the genome and undermine its functionality. After a few seconds, an auto-destruction program ("apoptosis") is normally initiated in the cell, At lower exposures, the cell may survive and simply be damaged.
All higher organisms (both plant and animal) are protected from low exposure to UV by their external structures (skin or cortex). Small organisms such as bacteria and protozoans lack these protective structures and can be very sensitive to UV radiation. UV rays themselves are quite delicate and can be blocked by filters such as some gasses (the ozone layer around the earth), glass, water, plastic, etc.
The effectiveness of UV sterilization is proportioned to its power and the amount of time of the exposure. The aquarium water must pass very close to the UV bulb and at specific speeds to allow for sterilization. The UV sterilization is done outside the aquarium since it will kill all bacteria and harm fish, invertebrates and plants.
In nature, there are no sterilizers. UV rays are filtered out before they reach the ground [this is why the thinning and depletion of the ozone layer is so critical]. Natural waters are not sterilized but they are perfectly clean. There is no reason to use sterilization in an aquarium in normal conditions, and most aquariums work perfectly in the absence of any sterilizing device. Aquariums that are overstocked or receive few water changes contain an increased concentration of bacteria that can be harmful. A UV sterilizer will lower the abundance of bacteria and other micro-organisms but only those in the water as it passes through the unit. Those that are scarcely mobile--attached to the substrate, wood, rock or plant leaves, on the fish or in its mucus--are not affected.
Both UV sterilizers and ozonizers [these are also discussed in the article] can be necessary, sometimes indispensable, to solve specific problems, but they should be used only when actually needed, with the right cautions, according to specific techniques.