Congress passed the Residence Act as part of the Compromise of 1790 brokered among James Madison, Thomas Jefferson, and Alexander Hamilton. Madison and Jefferson favored a southerly site for the capital on the Potomac River, but they lacked a majority to pass the measure through Congress. Meanwhile, Hamilton was pushing for Congress to pass the Assumption Bill, to allow the Federal government to assume debts accumulated by the states during the American Revolutionary War. With the compromise, Hamilton was able to muster support from the New York State congressional delegation for the Potomac site, while four delegates (all from districts bordering the Potomac) switched from opposition to support for the Assumption Bill.
The name 'Residency Act" refers to the place where the government of the United States would reside. The need for a special district for the national capital was recognized in 1783 when a group of demobilized soldiers attempted to press their claims for wages owed by surrounding the seat of the Continental Congress in Philadelphia. Despite requests from Congress, the Pennsylvania state government declined to call out its militia to deal with the unruly mob, and so Congress was forced to adjourn to New Jersey abruptly. This led to the widespread belief that Congress needed control over the national capital. As James Madison wrote in The Federalist No. 43, "Without it, not only the public authority might be insulted and its proceedings interrupted with impunity; but a dependence of the members of the general government on the State comprehending the seat of the government, for protection in the exercise of their duty, might bring on the national councils an imputation of awe or influence, equally dishonorable to the government and dissatisfactory to the other members of the Confederacy." This belief resulted in the creation of a national capital, separate from any state, by the Constitution's District Clause.
Ironically, by authorizing the creation of the separate federal district that was not a part of any state, the Residency Act deprived the residents of the territory selected for the District of Columbia from have representatives in Congress, as the Constitution provides only for representative to be drawn from the states. A movement to amend the Constitution to allow the District of Columbia to have congressional representation has thus far not met with success.