This is an insurance policy that provides the opportunity to receive free medical services in emergency cases. The list of services that the insurance covers depends on the type of policy.
For example, some are intended for professional athletes and can cover medical care for a jockey who has fallen from a horse, while others only provide protection in a few situations.
The traveler chooses the type of medical policy. Without insurance, they will not be approved for a visa, for example, to the USA or Canada. These countries have expensive treatment, so consulates are interested in the tourist or their insurance company paying the bills.
If a traveler is going to a country with a simplified or visa-free regime, it is not necessary to get insurance. But this can protect them from unexpected expenses.