An index provider creates the index (similar to a software company's IP) to track the performance of a market, market segment, investment strategy, or asset class. A financial institution enters into a license agreement with the index provider (obtaining access to the IP) allowing them to create and market an investable vehicle that is designed to replicate the performance of the underlying index as closely as possible, before deduction of product management fees. These product management fees are part of what you pay (e.g. the expense ratio) as an investor in the product. The investment company uses a portion of what you pay the fund to cover the license fee owed to the index provider.
This how the index provider makes most of its money. If total revenue > total expenses, then they profit from their operation.
In the case of actively managed products, mutual fund profits are often at the expense of the funds share owners. Investment advisors and broker-dealer firms usually get a slice as well. This is less so for indexed strategies (less costly to manage) and varies depending on scale and the ownership structure of the fund complex, which includes marketing and distribution.
The most economic option for most investors not interested in managing their own investments is an indexed option. Just know index selection as well as type of investment vehicle can have important implications for your resulting after-tax compound rate of return.