Ever taken out cash from an ATM machine and gotten socked with a $3 fee (or worse)? You probably weren't thrilled about that.

Nobody likes those fees. Except banks.

America's three biggest banks -- JPMorgan Chase (JPM), Bank of America (BAC) and Wells Fargo (WFC) -- earned more than $6 billion just from ATM and overdraft fees last year, according to an analysis by SNL Financial and CNNMoney.

That equates to $25 for every adult in the United States.

There's so much frustration over these fees that they have become a presidential campaign issue.

Hillary Clinton called ATM fees "usurious." Bernie Sanders vowed that if he's elected president, he will cap ATM fees at $2.

Consumers now pay over $4, on average, to withdraw their own money from an out-of-network ATM, according to Bankrate.

"In my view, it is unacceptable that Americans are paying a $4 or $5 fee each time they go to the ATM," Sanders said in a recent speech.

Related: What crisis? JPMorgan Chase reports big profit

Big profits on fees

The outrage comes as Americans are finding out exactly how much banks really profit from those pesky ATM and overdraft fees. For the first time, banks were required to disclose this information publicly in 2015.

While ATM fees get the most attention on the campaign trail, overdraft charges are the most profitable for banks.

America's big three banks made over $5.1 billion last year from overdraft fees alone.

Banks aren't supposed to charge customers overdraft fees when they use an ATM to get cash unless the customer chooses or "opts in" to get the cash despite the fee.

A 2014 Pew study found more than half of the people who overdrew their checking accounts in the past year didn't remember consenting to the overdraft service.

Related: Everyone hates stocks again. Time to buy?

Overdraft fees put people at 'serious risk'

"Consumers who opt in to overdraft coverage put themselves at serious risk when they use their debit card," said Richard Cordray, director of the Consumer Financial Protection Bureau.

The typical overdraft fee is $34, yet a CFPB study found that the majority of overdrafts occur on transactions of $24 or less.

"Consumers really need to look at the fine print," says Christopher Vanderpool, an analyst at research firm SNL Financial.

By law, people can opt out of ATM overdrafts at any time. That way they will not be able to take out money at an ATM if their account balance goes below $0. That said, banks can still levy a fee if someone's balance goes negative because a check is cashed or an automatic payment such as rent goes through and there aren't sufficient funds to cover it.

The CFPB study notes that if someone borrowed $24 for only three days and paid an overdraft fee of $34, that "loan" from the bank would carry a whopping 17,000% annual percentage rate (APR).

Related: The Obama economy in 10 charts

Fees are growing

Many large banks like Wells Fargo say they have put a lot of effort into clarifying their overdraft fees and helping customers make smart choices.

"Overdraft behaviors are becoming more managed by our people," said Ricky Brown, president of BB&T (BBT) bank on an earnings call last year.

But the data for the first three quarters of 2015 doesn't back that up. It shows that overdraft fees grew every single quarter for the big banks.

CNNMoney estimated what the banks would collect on fees in the final three months of 2015. It's often the most profitable time of the year since people are doing more transactions around the holidays. Still, CNNMoney assumed that banks earned the same in the fourth quarter on fees as in the previous quarter.

The result is that JPMorgan took in $1.9 billion from customer overdrafts. Bank of America and Wells Fargo took in $1.6 billion each.

The CFPB is considering whether to implement additional rules on overdrafts.

Fees on the "regular Joe's" bank account made up about 4% of operating revenues for America's biggest banks last year, according to SNL Financial.