When insuring your boat, you can insure it fully, or you can get liability insurance.
Full insurance. If you hit a rock and damage your keel, full insurance will cover the work, and even the tow to the nearest facility, it will also cover the cost of salvaging it if the vessel sinks. The insurer may not cover sailing in certain areas, especially if outside of protected waters.
Getting full insurance for offshore sailing is possible but expensive, and they have strict requirements. For instance, we met many sailors in Tonga who had a 'leave by date' to sail to New Zealand. This date marked the official start of cyclone season. If they left past this date and something happened to their boat, then their insurance would not have covered the costs. This practice is unfortunate, and downright dangerous, but it is how insurers protect themselves.
Liability insurance. This type of insurance is required if you want to dock anywhere, its purpose is to cover costs if the boat damages facilities or other boats. Even when cruising the world, most places will require it, but it is often better (and cheaper) to purchase it locally—we did this in New Zealand, and in Mexico.
In both cases, your boat will need a survey to get insurance. A full out-of-water survey is required for full insurance. Some companies in Canada ask that boats older than 12 years old be surveyed every 5 years, but wooden boats need a survey every 3 years. An in-water survey may be enough for liability, but it depends on the age of the boat.
What happens when a surveyor comes to your boat? A surveyor for insurance will look at different things than one for the purchase of a boat, what they care about most is if the vessel is seaworthy. They will check thruhulls, shaft seals, keel bolts, electrical connections, battery setup, check the interior wood for water stains (indicative of water seepage, rot), engine mounts, chain plates, bilge pumps, etc.
Out of water. During an out of water survey, the surveyor will sound the hull with a hammer (tap test) to check for water instruction in the core. They will check the keel, hull for damage or osmosis. There can be surface osmosis (under paint, not severe), or hull osmosis (more severe). They will check your rudder, its alignment, and whether it wobbles or not. They'll also look at thru-hulls.
Empty the boat.If living aboard, you'll have to clear all lockers and surfaces so that they can look through every compartment without having to move anything to get to it (common courtesy). Many surveyors don't want to survey liveaboard boats because people don't want to do this, which makes it very difficult for them to do their work.
We sailed offshore without insurance from 2016 to 2021, because we did not have enough sailing experience and no one wanted to insure us. It was risky, but we sailed with caution. Keeping an eye on the weather, studying charts carefully, picking good anchorages, and having a good rode and anchor was our best possible insurance, but there are dangers that are beyond anyone's control, dangers that even the most skilled sailor cannot avoid, e.g., a shipping container adrift, dead heads at night, whales, etc.
A downside to insurance companies is that they are slowly pricing out small yacht owners. A machinist may not want to help a non-insured sailor with a small fix, because they can charge more to those with it. Small scale projects are not big money makers, and they are more likely to refuse them.