The most common and popular way to treat pathogens (nasty things) in pool water is Chlorine.
Chlorine comes in granular, tablet and liquid forms. There are granules and tablets that have stabiliser added to them making them more resistant to the degrading effect of sunlight and these are used to maintain the correct levels in the water. Also available are granules that do not have stabilisers added, usually known as Granular Shock - this is used every 2 to 3 weeks during the season to give the water a light shock and stop any nasties that may be thinking of growing. Then there is the Liquid Chlorine - this is of a higher strength with a shorter active life of 48 hrs and is pure Chlorine. The Liquid is used to “Shock” the pool when there is a problem with Algae or when putting the pool to bed for the Winter or waking it up for the Summer. There are also Granules known as Superfast Shock (not to mistaken for Granular Shock) which do the same job as the Liquid. The Superfast Granules are a little costlier than the Liquid but are much easier to handle and do not have a shelf life. Whereas the Liquid starts degrading the from the moment it is manufactured and should only be kept from 6 to 8 weeks after purchase, it is also very heavy to carry.
Some people choose to use Bromine, which is a non-chlorine alternative as a sanitiser - this is purely a personal choice.
When added to water Chlorine produces, amongst other things, Hypochlorous Acid. Hypochlorous Acid kills bacteria and other pathogens; it attacks the lipids in the cell walls and destroys the enzymes and inner structures through an oxidation reaction.
Unfortunately, Hypochlorous Acid is not particularly stable and may react with other chemicals to form new compounds; it also reacts to the ultraviolet rays in sunlight which cause it to degrade. Stabilised Chlorine will contain a stabilising agent such as Cyanuric Acid that reacts with the Chlorine lessening the effect that the ultraviolet light has on it therefore slowing down the degrading process.
Hypochlorous Acid can and may also combine with other chemicals in the water forming compounds that are not very effective sanitisers. For example, Hypochlorous Acid may combine with Ammonia, found in urine, amongst other things, to produce various Chloramines. Not only are Chloramines poor sanitisers, but they can irritate the skin and eyes and have an unpleasant odour. The distinctive smell and eye irritation associated with swimming pools are actually due to Chloramines, not ordinary Hypochlorous acid - a strong smell usually means there is too little free Chlorine (Hypochlorous Acid), rather than too much. These Chloramines are lighter than water but heavier than air, so they will rise and sit in a band of about 6 inches on the surface of the water, that is why they are so noticeable in an Indoor Pool as you don't have the same air movement and breeze as with an Outdoor Pool. To get rid of Chloramines the pool needs a "Shock" Treatment. This means adding an unusually strong dose of Liquid Chlorine to kill off any organic matter and unhelpful chemical compounds.
This leads us on to the second major element in pool health, pH levels which are relevant to Chloramine formation.