To exercise exclusive Legislation in all Cases whatsoever, over such District (not exceeding ten Miles square) as may, by Cession of particular States, and the acceptance of Congress, become the Seat of the Government of the United States.The Residence Act of 1790 did just that, cutting chunks out of Virginia and Maryland that formed a square ten miles on each side. This area then contained the cities of Georgetown and Alexandria, and construction began on the federal city of Washington east of Georgetown in 1793, after a couple of years designing it and picking the exact place.
Things muddled along from there, with DC returning the part that originally came from Virginia in 1846, and Washington and Georgetown governing the area jointly with mixed success. After the Civil War, people started coming to DC a lot more, and in 1870 the district had a population of 132,000, though the infrastructure was laughably unable to deal with that many. Some members of Congress, with the sense we've come to expect, proposed that the capital be moved due to the lack of proper roads and sanitation, rather than, you know, fix them.
That didn't happen, but in 1871, Congress combined Georgetown, Washington, and the rest of the district (where nobody much lived) into a single city for the whole district. The Organic Act (bills establishing an agency's authority over federal lands are always called organic acts) also established a new legislature, with an eleven-member upper house appointed by the President and a lower chamber consisting of 22 elected delegates. President Grant appointed a member of that upper house as governor in 1873, but after Alexander Shepherd spent three times as much money as was actually in the budget trying to make the place less of a craphole, Congress rescinded all home rule privileges. For the next century, DC would have a board of commissioners running the place, with two members appointed by the President with Senate confirmation, and one from the Army Corps of Engineers.
Well, okay, not quite a century. In 1967, Johnson revised this to eleven people (nine in the council, one mayor, and his assistant), but they were still all appointed by the President. Six years later, DC finally got the right to elect its own leaders.
The 1973 Home Rule Act, which is still in effect, established a mayor and a thirteen-member council, eight of whom were elected by the wards and five at-large. Unfortunately, the whole thing was still hamstrung; Congress could veto any act of the council, and in fact DC's budget is included in the national bill. In addition, DC's council can't tax anyone who works in DC but doesn't live there, and cannot tax federal buildings. Of course, nobody can do that, and the Payment in Lieu of Taxes program exists to supply funds to make up for the lack of property taxes, but according to the General Accounting Office (now the Government Accountability Office), DC doesn't get as much as it needs, since the formula doesn't take into account the constraints DC operates under which no state has.
Basically, DC has the government that Congress allows, and there is no way for residents to petition for change, since the elected delegate, Eleanor Holmes Norton, cannot take part in any vote where her input would change the outcome, thus eliminating any actual influence she could have in the body.