So you have a computer with, say, a database on it. No-one else can access that database unless theyāre sitting at your computer. If you want someone else to be able to access it in other computers, say, via an internet connection, you need to make it available on that network. So you install a program called a web server (I mean you could write your own, but thatās a wee bit out of scope) which translates incoming messages of a specific format from the network into stuff you can use and letās you send messages back out. Then you can make it so that when certain messages arrive, you get something from the database and send it back.
NodeJS, for example, has a server built into the program. With a Node application, you upload itās constituent files somewhere, on a computer in some data centre, and you tell it to start, then it just sits on that computer and runs, waiting for incoming connections. Or a website, what you generally do is upload the files somewhere that already has a web server installed. And when you put those files in a specific directory, the web server knows to serve them when requests come in.
You have to do that because generally there has to be one place where your program runs. If you make an online shop, for example, users canāt just download the whole āshopā program and use it on their own computers without a network: itās not connected to anything. It would be like having a copy of a physical shop in your living room, except that everything in it is just photographs of the goods & the money is just pretend notes.
Or if you make a website, it has to be hosted at a specific place. If you have some control system for some machinery, it canāt just live on a userās computer, thereās a physical thing it needs to be connected to.
You canāt do anything particularly useful, internet-wise, without servers. Single-player games, or single-user applications like calculators or drawing programs, theyāre fine, you donāt need a server (edit: except how would you download them? You couldnāt. You would have to actually go and get the programs on physical media, as happened pre-internet). But most anything internet-related has to actually live somewhere, a physical location that can be accessed via a URL, and that place canāt be a single persons computer.
āServerlessā is little bit of a misnomer, it means āon a serverā. Itās just that you donāt have to set up and manage that server yourself.