What makes buying insurance rational?

Hey, everyone! So I’ve been reading an article about the expected utility, apparently to figure out whether the risk is worth taking you multiply expected value of the outcome by it’s probability.

And apparently insurance companies can make money because the expected utility of buying insurance is lower than it’s price.

So why would buying insurance be the rational action? I mean intuitively it makes sense(you want to avoid the risk), but it doesn’t seem to fit well with this idea. If insurance is almost by definition is worth slightly less than it’s price, how is it worth buying?

(sorry if it’s a dumb question)