Bemoaning money and influence in Washington, D.C., is a favorite pastime of American politicians, but you'd be hard pressed to find a lawmaker that didn't take campaign contributions or meet with lobbyists. President Donald Trump made "draining the swamp" a cornerstone of last year's campaign, but his administration has hired lobbyists to key posts in regulatory agencies. Lobbyists are such a large presence in the D.C. eco-system, it's hard to work there without being drawn into their orbit.

There were 11,143 registered lobbyists in 2016, according to the Center for Responsive Politics, which means there are about 20 registered lobbyists for each member of Congress. More than three $3 billion was spent on lobbying in 2016, or about $5.5 million per lawmaker. So how did this sub-industry, which represents nearly all industries and their interests, get so big? And how is it legal?

Read: Trump’s Pick For Drug Czar Hauled In Thousands Of Dollars From Drug Distributors He Wrote Bill To Protect

Lobbying dates back to the earliest days of the U.S. and the term is actually older than the country. The Oxford English Dictionary cites examples of the "lobbyists" that appeared as early as 1640, when British citizens would speak to their members of the House of Commons in "lobbies." In 1792, Virginia Revolutionary War veterans hired William Hull to lobby congress for more pay. By the 1820s the term "lobbying" became a synonym for exerting political influence in the U.S. After the Civil War, with widespread industrialization and the rise of the corporation, lobbying began in full force. In 1869, one newspaper columnist called the the lobbying industry a "dazzling reptile, this huge scaly serpent," that slithered through Congress with its "slimy length from gallery to committee room."

Lobbyists were an easy target for political commentators, both in 1869 and today, but they are protected by the First Amendment of the Constitution, which enshrines "the right of the people peaceably to assemble, and to petition the government for a redress of grievances."

But by the end of World War II, Congress felt the need to start tracking and regulating lobbyists. In 1946, Congress passed the Federal Regulation of Lobbying Act, which required that any person who spent more than half their time lobbying members of the government to register with the government. The timing of this was not coincidental, as World War II gave birth to what President Dwight Eisenhower would later call the "military industrial complex."

In 1954, the Supreme Court narrowed the scope of the Lobbying Registration Act in United States v. Harriss, ruling the law only applied to paid lobbyists who met directly with members of Congress to discuss pending or proposed federal legislation. Under the ruling, lobbyists who met only with congressional staff, and not members of Congress, would not have to register under the act. For nearly five decades, this ruling governed how lobbying worked in the U.S, until Congress unanimously passed the Lobbying Disclosure Act of 1995.

That bill required lobbyists to report their clients, the issues they lobbied on and who they lobbied. Lobbyists were also required to estimate how much income they received from clients. Further, the bill expanded requirements for who had to register as a lobbyist. No longer could lobbyists avoid registration by only meeting with congressional staffers, instead of members of Congress directly.

Roughly 6,000 lobbyists were registered at the time the legislation was passed and that number grew to more than 10,000 by 1998. But in recent years, the number of lobbyists have declined. After hitting a peak of 14,822 in 2007, there are now only just over 11,000.