A web server is server software, or a system of one or more computers dedicated to running this software, that can satisfy client HTTP requests on the public World Wide Web or also on private LANs and WANs.
A web server can manage client HTTP requests for Web Resources related to one or more of its configured / served websites.
A web server usually receives incoming network HTTP requests and sends outgoing HTTP responses (one for each processed request), along with web contents, through transparent and / or encrypted TCP/IP connections (See also: HTTPS) which are started by client user agents before sending their HTTP request(s). Maybe in future web servers will be able to handle also other types of transport protocols for HTTP requests.
The primary function of a web server is to store, process and deliver web pages to clients. This citation was good a few decades ago but nowadays it is better to use the terms of Web contents and / or Web resources instead of Web Pages because the first ones cover all kind of contents that can be delivered to clients by web server. Examples of Web contents may be HTML files, XHTML files, image files, style sheets, scripts, other types of generic files that may be downloaded by clients, etc.
A user agent, commonly a web browser or web crawler, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource or an error message if unable to do so.