Campaign finance is a field of law governing the spending of money on political elections. Federal law defines the rules for federal elections, and the Federal Election Commission is the regulatory body that oversees complaints and disputes in financing federal campaigns. State law dictates the rules for state elections.
There are two types of funds: hard money and soft money. In simple terms, hard money consists of donations to campaigns, while soft money consists of other expenditures that do not "expressly advocate" the election or defeat of a candidate.
Until it was overturned in January 2010, Federal law prohibited corporations and unions from donating directly to a candidate for him to spend on his campaign, but most states allowed for some types of corporate donations. Small corporations that satisfy the "MCFL" exception have been allowed to donate to candidates since 1986. Instead, corporations and unions were forced to establish political action committees (PACs) for raising money for the purpose of donating to campaigns - a restriction which the Supreme Court has since called "burdensome alternatives... expensive to administer and subject to extensive regulations... onerous".
Incumbents have an incentive to restrict the ability of challengers to raise money, and also to prevent independent groups to spend money criticizing the incumbents. Repeatedly legislators have passed limitations on campaign spending, but many of those restrictions have been declared unconstitutional under the Free Speech Clause of the Constitution.
The McCain-Feingold Campaign Finance Act imposed strict prohibitions on issue ads by any person or entity other than the candidates with two or three months prior to an election. President George W. Bush signed it into law even though he had spoken against it in his campaign, and even though he declared in his signing statement that he considered parts of it unconstitutional under the First Amendment. The U.S. Supreme Court has declared much of this law unconstitutional.