A whip is an official in a political party whose primary purpose is to ensure party discipline in a legislature. Whips are a party's "enforcers", who typically offer inducements and threaten punishments for party members to ensure that they vote according to the official party policy. A whip's role is also to ensure that the elected representatives of their party are in attendance when important votes are taken. The usage comes from the hunting term "whipping in", i.e. preventing hounds from wandering away from the pack.
In the United States there are legislatures at the local, State, and Federal levels. The Federal legislature (Congress), State legislatures, and many county and city legislative bodies are divided along party lines and have Whips, as well as Majority and Minority Leaders.
Both houses of Congress, the House of Representatives and Senate, have Majority and Minority Whips. They in turn have subordinate "regional" Whips. In the Senate, the Majority Whip is the third-highest ranking individual in the majority party (the party with the most seats). The Majority Whip is outranked by the Majority Leader and, unofficially, the President pro tempore; because the office of President pro tempore is largely honorific and usually given to the longest-serving Senator of the majority, the Majority Whip is in reality the second-ranking senator in the Majority Conference in terms of actual power. Similarly, in the House, the Majority Whip is outranked by both the Majority Leader and the Speaker. Unlike the Senate's presiding officer, the Speaker is the leader of his or her party's caucus in the House.
The Whip position was first created in the House of Representatives in 1897 by Republican Speaker Thomas Reed, who appointed James A. Tawney as the first whip. The first Democratic Whip, Oscar Wilder Underwood, was appointed around 1900. In the Senate, the position was created in 1913 by John W. Kern, chair of the Democratic caucus, when he appointed J. Hamilton Lewis as the first Whip, while Republicans later chose James Wadsworth as the party's first in 1915.