The Consumer Financial Protection Bureau is in the spotlight this week thanks to a leadership fight over control of the financial watchdog agency. The battle started last Friday when CFPB’s director, Richard Cordray, resigned. Hours later, President Donald Trump named White House budget director Mick Mulvaney as CFPB’s acting chief.

That prompted a lawsuit from Leandra English, who was appointed the bureau’s deputy director Friday after Cordray resigned. In her suit, filed Sunday in the United States District Court for the District of Columbia, English claimed that she’s the CFPB’s rightful acting director and sought to temporarily block Mulvaney from taking over the agency. English and Mulvaney both showed up for work at the agency’s offices Monday, adding to the sense of confusion over who’s in charge. (Mulvaney brought donuts to the office for co-workers).

As the fight plays out in court, it’s a good moment to go over the agency’s history, what it does, and its impact on American consumers.

How did the Consumer Financial Protection Bureau come into being?

The agency was created under the Dodd-Frank Wall Street Reform and Consumer Protection Act of 2010, commonly known as Dodd-Frank. The idea for a financial watchdog agency came from Sen. Elizabeth Warren, D-Mass., a Harvard Law School professor at the time. Warren first proposed creating the agency in 2007 as a way to better regulate mortgages, student loans, and other financial products.

In 2010, then-President Barack Obama appointed Warren as special adviser in charge of setting up the new agency, and she was widely expected to become its first director. But Republicans opposed a potential Warren nomination to the post, and Obama named Cordray as the agency’s first director when it launched in 2011.

How is the CFPB structured?

Before the Consumer Financial Protection Bureau was established, there were seven different federal agencies tasked with overseeing financial consumer issues. The Obama administration folded the various efforts under one umbrella agency, and gave the CFPB significant autonomy to carry out its work. The agency is funded by the Federal Reserve, and its director is appointed to a five-year term. The director does not report directly to the president, and can only be fired for “inefficiency, neglect of duty, or malfeasance.”

What is the agency’s scope?

Dodd-Frank gave the CFPB and its director broad authority to create and enforce regulations. According to the section of the financial reform law that created the agency, CFPB has “authority to administer, enforce, and otherwise implement federal consumer financial laws, which includes the power to make rules, issue orders, and issue guidance.”

In addition to its regulatory power, the agency also has authority to issue subpoenas, conduct investigations and take legal action in federal court to enforce consumer protection laws. CFPB also has broad regulatory authority over financial institutions with assets over $10 billion.

What has the CFPB accomplished?

According to the CFPB, the agency has provided $12 billion to 29 million Americans hurt by predatory student loans, misleading credit card services, and other financial products. In one high-profile case, Wells Fargo was fined $185 million in 2016 after CFPB and federal regulators found that some of the bank’s employees had opened more than 1 million accounts and applied for nearly 600,000 credit cards without authorization from clients. In march Wells Fargo reached a $110 million settlement with customers.

CFPB also created new consumer protection rules for mortgages and payday loans. The agency created a financial consumer database where people can research loan companies, and says it has handled more than 1.2 million complaints from consumers.

The political debate over CFPB

The agency has been controversial since its inception six years ago. Democrats like Warren say the CFPB was sorely needed in the wake of the 2008 financial crisis, and they’ve fought to keep the agency’s authority — and the broader Dodd-Frank law — intact. But Republicans say CFPB is another example of government overreach that stymies consumer choice and economic growth.

Republicans in Congress and conservative groups have called for limiting CFPB’s power or doing away with the agency altogether. Last year, the United States Court of Appeals for the District of Columbia ruled that CFPB’s structure was unconstitutional. CFPB asked the court to reconsider, and the case was reheard earlier this year. The court has not yet issued a new ruling.

What’s at stake in the current leadership fight?

In the long run, the current fight over interim control of the agency is irrelevant. With Cordray’s resignation, Trump will name a new director to a full five-year term — and Cordray’s replacement will presumably share the president’s views on financial regulations. Still, the leadership dispute

highlights the Republican-controlled Congress and Trump administration’s ongoing effort to roll back Obama-era financial reforms.

Trump has taken steps through executive action to eliminate regulations for the financial sector, and in June, House Republicans passed a bill that would dismantle Dodd-Frank. Mulvaney is also an outspoken critic of the Consumer Financial Protection Bureau.