The stock market keeps going higher, but fees to own funds keep going lower.

Investors paid less to own funds last year than ever before: about $48 in expenses for every $10,000 invested, according to a study by fund tracker Morningstar. That's roughly half of what investors paid in 2000, when expenses ate up $93 of every $10,000 invested. Last year alone, investors saved a cumulative $5.5 billion thanks to the drop in fees from 2017, the second largest decline on record since 2000.

"Every $1 is worth fighting for," said Ben Johnson, director of global ETF research at Morningstar. "And that's $1 today that can be many dollars down the road."

While the difference of $1, or a few hundredths of a percentage point in expense ratios, may not sound like much, it adds up over the decades that a 401(k) account can grow compounded returns. And as those nest eggs get bigger, each sliver of a percentage point becomes worth more and more dollars.

Index funds have played a big part in the declines in fees. Instead of hiring teams of analysts to winnow out the best stocks and bonds, index funds merely try to track the S&P 500 or another index. That allows them to keep costs low, and passive funds kept $15 in fees on every $10,000 invested last year. Fierce competition has whittled down that number — it's fallen from $25 a decade ago. Some funds now even charge zero in fees.

But investors themselves are also driving the trend by voting with their dollars. They moved a net $605 billion into the funds that rank in the bottom 20% of their category for fees last year. Among all the other funds, investors yanked out a total of $478 billion. Much of that movement has been at the direction of financial advisers, who increasingly are charging fees for their service rather than getting commissions for buying specific funds.

The average actively managed fund still charges about 1.8 times as much as the average index fund. But these funds have a wide range of expenses, and of the select few that investors have been seeking out, it's typically been the lowest cost ones.

With so much pressure on fees, the industry has been introducing more funds that act almost as a hybrid of index and actively managed funds.

Like an S&P 500 fund, these hybrid funds track an index. But these indexes are more fine-tuned and follow strategies that are similar to ones active managers use. Some "low volatility" funds track indexes that include only stocks with smaller swings in price than the broad market, for example. Others follow indexes that hold only stocks whose prices have the highest momentum.

The industry calls these "smart beta" funds, and last year smart beta stock funds had an expense ratio of 0.17%, meaning they kept $17 of every $10,000 invested. That's in between the $8 for traditional stock index funds and the $70 for actively managed stock funds.

Investors should be careful not to shop only by fees, though, said Morningstar's Johnson. How the fund is constructed matters just as much — if not more. One low-volatility fund may have slightly lower expenses than another but track a much different index, which ends up leading to big differences in returns.

"Focusing too narrowly on fees can become a risk," Johnson said.