To the extent there's money left over (claims are less than the premiums plus growth), the insurance company generates a profit, while if the claims exceed the premiums plus growth, the insurance company has a loss. Since insurance companies are a going concern, with a steady stream of new premiums coming in, claims being paid out, new policies being established, and old policies that are allowed to lapse, the ongoing management of the insurance company is a bit more complex, but the fundamental equation remains the same: premiums + growth - costs = claims + profit margin. The insurance company sets the premiums, manages the costs, invests for growth, and aims for a certain profit margin that will be left after anticipated claims.
Of course, this also means that being able to effectively anticipate claims is absolutely crucial for the effective function of a life insurance company, which is no small feat in a world where any individual insurance claim - from the death under a life insurance policy to a fire burning down the house under a homeowner's policy - can seem exceeding random on a case by case basis. Fortunately, though, what we see from the "law of large numbers" is that, given a large enough sample size, the actual number of incidents average amount remarkably close to the expected value (assuming, for the time being, we can make a reasonable estimate of the expected value in the first place). What is "random" at the individual level is remarkably stable in the aggregate.
Thus, for instance, while in any individual scenario, the person does or doesn't die and the house does or doesn't burn down - a very random, binary outcome - with a large pool of insured individuals (or properties), the frequency of claims becomes remarkably consistent, allowing the insurance company to be able to set an effective premium that allows the whole mechanism to work in the first place. In turn, this allows for the availability of everything from life insurance to homeowner's insurance; for some newer types of insurance coverage, we may not get the expected value right initially - such was the case early on for disability insurance, and more recently for long-term care insurance - but the principle remains the same: in large numbers, claims can occur with relative consistently.
Of course, with enough consistency, the outcome is essentially an assured loss for any individual insurance policy owner; on average, the policyowner's expected value is reduced by the costs (and profit margin) of the insurer. But access to insurance allows the individual to turn what could be a relatively extreme financial impact - like the loss of a family's primary breadwinner or the house that they live in - into a much smaller, manageable cost. While technically the expected value of the insurance transaction is financially diminished by insurance company overhead and profit margins, it provides a way for an individual facing a binary outcome - the event does or doesn't happen - to participate in the much steadier law-of-large-numbers outcomes instead.