The practice of tipping may have begun in the late Middle Ages when a master gave his servant a few coins as an expression of goodwill. By the 16th century, guests at English mansions were expected to give a "vail" or a small amount of money at the end of the visit to compensate the owner's servants who did work above and beyond their ordinary duties.
Before 1840, Americans did not tip. But, after the Civil War, newly rich Americans visited Europe and brought the practice back home to show that they had been abroad and knew genteel customs.
By the 1900s, Americans considered tipping to be the norm and were frequently criticized for overtipping.
Benjamin Franklin said, "To overtip is to appear an ass: to undertip is to appear an even greater ass."