Tonic water is a kind of soda that tastes slightly bitter. The quinine in tonic water has a bitterflavor. Originally, it was to protect people against malaria. The first drug against malaria was chloroquine, which became available in 1934. The first time tonic water became available was in the 1860s, over 70 years before the first drug.
Tonic water is often called Indian tonic. People drank it in Africa and Southeast Asia, where malaria was common. At the time, quinine was a powder that was mixed with water or soda water. Because quinine on its own is bitter, sweeteners were often added (usually sugar). Often, it was mixed with liquors. Gin and tonic is the most common.
Quinine should not be used during pregnancy as it will have an influence on the unborn child. There are also other conditions where quinine (and tonic water) should not be used.
Today, tonic water contains a lot less quinine than before the drug was developed.