Web hosting : how does it work?

What is web hosting? Let me try to compare the web hosting with a shop where you can store and display your products which you would like to sell.