The first mention of bow ties goes back to the 17th century. The Croat soldiers during the Prussian war of the 17th century used a scarf around the neck to hold together the opening of their shirts. Very soon upper classes in France started wearing this new style in necktie - they called it cravats, and cravats evolved in bow ties in the 18th and 19th centuries and became very fashionable among men.
In the beginning of the 19th century the bow tie was a vital component of a full attire. This changed in the 1900s when it became common among surgeons and men in the academic arena. Even though it became less fashionable following the end of the Second World War, it still makes up an essential part in men's formal wear in today's world.
And of course we should mention that a bow tie is not only male accessory any more. In the 1920s and 30s bow ties officially crossed gender lines into women's wear.