The early history behind tipping was basically to not pay black people and keep some simulacrum of slavery. Black people were historically pretty predominant in the hospitality industry - a good way to pay them shit, and make them dependent on the generosity of white people.