Important: Don't get mistaken, unlike common belief there are still servers or infrastructure but someone else takes care of them and who is this someone else, well essentially the cloud providers like Azure, AWS or GCP. Click here (video) to understand.
Before moving ahead let me give some examples of serverless so that you have something to relate the concept with. From Microsoft Azure stack we have Azure functions, the google counterpart is Google cloud functions and from Amazon we have AWS Lambda.
So, let's break it this way. Serverless is a cloud computing application development and execution model that enables developers to build and run application code without provisioning or managing servers or backend infrastructure. So basically you write simple and normally single-purpose code in the language you love, which are attached to certain events. Cloud Functions are triggered when an event being watched is fired. Your code executes in a fully managed environment. For example Azure functions can be configured to trigger on events like HTTPTrigger, TimerTrigger, QueueTrigger and more. Azure Functions supports many languages: C#, JavaScript, Java 8, PowerShell Core 6, Python, Typescript are just a few of them.
In a serverless setup, you just focus on writing your code and creating your application. You don't need to worry about provisioning servers, managing their capacity, or dealing with scaling. When someone uses your application, the cloud provider automatically takes care of running it. They spin up the necessary servers, handle the scaling to accommodate more users, and shut down servers when they're not needed. It's like having a magical team of invisible server caretakers working behind the scenes!
You can focus on writing your application code and don't have to deal with server management complexities. This makes development faster and less stressful.
You only pay for the exact amount of computing power and resources your app uses. There's no need to pay for idle servers or worry about overprovisioning.
When your app becomes super popular and gets lots of users, the cloud provider automatically scales up the resources to handle the increased traffic, so your app remains fast and responsive.
Cloud providers ensure your app runs across multiple servers, so even if one server has issues, your app stays up and running.
Forget about dealing with software updates, security patches, and server maintenance tasks. The cloud provider handles all of that for you.
Deploying your app is a breeze. You just upload your code, and the serverless platform takes care of the rest.
To summarise: You develop a piece of code in the language you love, and then deploy it on a cloud of your choice on a so-called serverless platform and you are done. No hassles of servers or infrastructure, just code and deploy.