How do backups work with web hosting?
The short answer
Good providers make a daily automatic backup of your site and keep it for at least a week or two. Check this before you sign up. Keep an occasional copy of your own somewhere else too. A backup stored with the same provider as your site is not full insurance.
In detail
Sites rarely die from server failure. Far more often it is a botched update, a hacked plugin or your own slip. Then you want to roll back to yesterday. Daily automatic backups with 14 to 30 days of retention are the norm at serious providers. The managed WordPress hosts include it as standard, and DreamHost and SiteGround do as well.
Check three things. How long are backups kept? Can you restore them yourself from the control panel, or does it take a support ticket? And is restoring included in the price? At some budget providers the backup is free but the restore costs extra. GoDaddy has historically worked that way.
A backup only really counts when it lives somewhere else. If you run WordPress, add a free backup plugin that sends a weekly copy to your own cloud storage. It takes five minutes to set up. After that you are covered, even if your provider has a very bad day.