What is the difference between insurance and gambling?

When insurance was born within London it was essentially a group of gamblers waging their bets on ships sailing around the globe as to whether they would sink or return safely and Edward Lloyd was the bookkeeper...