As well as rake, the amount of money deposited on such sites is massive and so a significant chunk of money is made by the sites investing the collective bankroll. There are however strict rules to stop companies using more riskier investment strategies.

As an aside, if you're comparing one site with another it isn't enough purely to compare the rake level. Some of the rake can be reclaimed in loyalty schemes etc. How these operate varies greatly from site to site.

As others have mentioned the main way these sites make money is from rake, where a percentage of the pot or entry fee is taken.

It might also be worthy to note that there are some rake-free poker sites such as BetRaiser.

These sites generate their income mainly from the transfer/deposit fees when you move money in and out of the site. Some sites also use their online poker purely as a side line to win over traffic into their online casinos.