That is assuming all health related costs can be predicted 100% correctly. If there is a 1/3rd chance to incur a cost then insurance lets you get away with only paying 1/3rd of the cost.
In that hypothetical in the best case the insurance company will never lose money by charging someone less than what they will have paid out to them and they will be able to sell this service to other companies, in the worst case they become essentially a bank.