See whether this makes sense to you. The container is a software program. Some of the main jobs of the container would be to create and initialize
servlets, manage their life cycle, find out which resource should serve a client request, allocate a
thread for each incoming request and manage web other web components like
JSP's , filters (their life-cycle) etc.
When you think of a web-server, you need to think about HTTP. A web-server talks HTTP. You can think of the web server as receiving the HTTP request from the client (browser) and passing it to the container which would select the appropriate resource to serve the request. The container then returns the response from the resource to the web-server. The web-server would format the actual HTTP response (header and body) and send it to the client.
You do not need to be ovely concerned about these differences. From the next chapter onwards, the book uses only the
word container (to mean both the container and the server)