This is both a complicated and simple matter...
First off, insurance works differently to how you expect, it’s a pool of money to fund everyone’s losses, not just yours, so if the pool behaves poorly, everyone pays a proportional contribution appropriate to their risk and the performance of the pool, most motor insurers expect to make a return including investment income of positive to negative 3%.
If it were solely based on your risk and you submitted a £100k claim for damaging someone then you couldn’t afford to repay that, hence why the pool works, equally if someone else was in the position that they couldn’t afford insurance and hit you then you could be out of pocket which isn’t fair (hence mid levy)
The true costs of insuring a male new driver, in a boring car, is over 10k when you look at low costs, it’s just subsidised by everyone else, same as people who are over 70, although not £10k initially
When the market performs poorly (which now it always does as new entrants and buyers chase the cheapest premium) rates go up also the cost of cars, repairing cars, injuries also increases year on year which has an impact on the pool performance.
Within this some insurers buy business in and then try to recover costs in subsequent years (like a loss leader model)
Its unlikely overall that the insurance company is making 5% margin overall, so far from robbing people.