While true for most insurances, life insurance can be a weird thing. Yes, life insurance can literally pay out more than it takes in. To know how takes a bit of a primer.
First, you have two major types of life insurance: Whole and Term.
Term life insurance is like car or house insurance - It covers a period of time, the term, and you're done.
Whole life insurance is insurance that you expect to have until you die.
What is actually going on with whole life insurance is that it's actually term life insurance plus an investment portion.
So let's say you get a $100k whole life insurance policy. After like 10 years, while you get a combined bill, in the insurance company's records, they've saved up $20k for when you eventually die, and they're only doing an $80k term policy now. Note the phrase "saved up".
Eventually they have $100k invested, at which point a number of things can happen, depending on how good of a company and contract you got. This can range from them still charging you premiums (bad!) to your premiums stopping, they'll pay out the $100k when you die, to even paying you $100k if you reach, say, 70 years old and haven't died yet.
The latter used to be pretty common when saving for retirement was very difficult, you had to be pretty wealthy to invest in the stock market, etc...
You'd buy a whole life insurance policy that paid out when you were 65 or so, and use that to retire on.