It is said that Gin was invented around 1650 in the Netherlands by Dr. Sylvuis, also known as Franz de la Boe, and was a Professor of Medicine in the city of Leyden, Holland. Originally, he intended this 'medicine' as a remedy for kidney disorders. He used neutral grain spirits flavoured with the oil of juniper. He called it genever after the French term genievre meaning juniper. By 1655 it was already being commercially produced and English soldiers serving in the area took a liking to the spirit.
In 1689, William of Orange, Dutch consort to Queen Mary of England, banned imports of French brandy and levied duties on German spirits, guaranteeing a market for Dutch spirits in England. At the same time, the distilling trade was opened to locals who began procuring 'Dutch Courage'.
During the English reign of William and Mary (1689), home production of Gin was encouraged. Some sources claim that one reason for this was the fact that drinking Gin was safer than drinking water. Another factor was that production and distribution of Gin was cheap. Local landowners produced it as a by-product of grain and taxes were very low. As a result Gin was cheaper than even beer or ale. Thus its popularity spread and it became synonymous with the poor, and abuse of the drink was rampant. In 1751 William Hogarth created the famous engraving 'Gin Lane' to display just how rampant the abuse really was.
In 1751, The Tippling Act was passed by Parliament - the beginning of the end of 'Gin Madness'. The act eliminated small gin shops and left the distribution of gin to larger distillers and retailers. Within a few years consumption was down to 2 million gallons per year (down from 11 million gallons in 1750!) and the quality of gin tthen improved. Gin was on its way to becoming a gentleman's drink.
The Gin produced around that time was the forerunner of what was known as Old Tom's Gin which was heavily sweetened. In the 1870's Dry Gin was introduced and it took on respectability in England once again. Finer establishments served "Pink Gins" (served with a dash of Angostura bitters), and the cocktail age dawned in England. About the same time prohibition began in the U.S.
During prohibition, the Americans used a different recipe to produce gin: by taking the poisons out of denatured alcohol to recover the ethyl alcohol. This was then flavoured with juniper, diluted, and bottled. The name for this was 'bathtub gin' and it probably tasted like the name. There were seventy-five different formulas to denature the alcohol, so if the purification process was not done by a skilled chemist where vile and even deadly results occurred.
Gin and tonics were, like gin itself, originally developed as a medicine. In this case to help fight malaria. When the British were in the East they became susceptible to malaria and eventually found out that quinine (an ingredient in tonic water) was useful for getting rid of the disease. Well, as you would probably expect, drinking Tonic Water by itself back then was pretty nasty (unless you've acquired a taste for it) and they had problems getting the British in the East to drink it.
Along comes our friend gin to be mixed with the tonic water, which not only made drinking it much more pleasant, but also created an excellent drink that would be remembered from then on, and even if its relationship to the disease was forgotten. So, as you can see, gin and tonic water came about due to medicinal reasons, then caught on later for their more pleasurable aspects.
On a minor note, the Lime (served in any good gin and tonic), being a citrus fruit, (and therefore containing Vitamin C), helps to prevent scurvy. Usually the limes are not the dominant ingredient of gin and tonic, so they won't actually get rid of scurvy if you've already got it - unless you drink a lot of gin and tonics of course!