Good question to ask, more people should be curious. Each product is priced differently.
Whole Life insurance like all plans, is priced by actuarial accountants. These are the people that when you were in university were studying in the room next door while you were playing drinking games. They do calculations based on over a hundred years of mortality and morbidity rates to determine claims experience, cancellations etc. which allow them to build in a profit margin for all products.
This particular product builds a cash reserve with all the premiums paid by all policy owners. It is sort of like a massive pension plan from which liabilities are paid (claims,admin costs, commissions, company profits) The residual is paid out to policyholders in dividends or cash value. So the answer is, don't worry the profits are priced in.
In the real world this profit is magnified by two main things that very few people in and out of the financial industry are aware of:
1) Life expectancy is always increasing so when you buy the policy at age 35, life expectancy is 82. By the time you get there it will be 88 so the insurance company will end up with 6 more years of premiums than they factored in.
2) Cash values built up through dividends on whole life plans are very enticing to people who don't manage money well so one day when they glance at their statement and see thousands of dollars just sitting there teasing them, they can't resist cancelling the policy and buying that big screen TV they wanted. Bingo, liability ends for the insurance company, they keep all the premiums paid, pay out some of the interest and pocket the rest.