Website hosting is basically a home for your website on the Internet. All websites are hosted on web servers, i.e. the actual computers that are connected to the Internet.
A good way understand this is to compare it to real estate. If you think of the web server as a large apartment complex, and your web hosting as an apartment you are rent for your website.
As such, when you purchase website hosting service, you are committing to pay a fixed monthly fee (rent) for the web server resources (utilities) that your website uses every month. This is the more popular form of web hosting, and it is called Shared Hosting, meaning you share the use of the web server (apartment complex) with other websites (renters).
Just as in real estate, website hosting (homes) comes in other forms. Instead of sharing with others, you may buy opt for a Dedicated hosting, where you are the only one living in the complex, your own private mansion.
So why would you opt for a Shared hosting vs a Dedicated hosting? Depends on what you want to be able to do in your home. If you own your own mansion, you can pretty much do what you want. Where as, if you are sharing with others, you have to live with some restrictions.
In order for your website to be on the Internet, it needs a home. So website hosting is not optional, you can't do without it.