A web application is different from other types of applications, such as desktop applications (for example, Photoshop), since most of the calculations are performed on a remote computer, and only the display data is sent to the user computer. Usually the user interface will be written in the form of "web technology" - HTML / JavaScript / flash, etc., And it will be viewed using a web browser, hence the name.
For this to work, the remote computer (server) must start an application that listens for client requests, performs some calculations, and returns a response to the user. For example, when you buy a book from Amazon, the purchase button sends a request to the remote application to process your order and returns a confirmation message.
There are many details in this process - the application should listen for requests, it should handle failures, possibly connect to the database and much more. Since most of this work is similar to any web application, an application server is usually used to use this work.
An application server is an application that knows how to run other applications and execute some of them. So, now when the user sends the request to the web application, the application server receives it, possibly extracts some data from it and checks it, and then tells your application to process the business logic. This way, you donโt have to worry about things like communication when you write a web application.
There are web servers for all kinds of technologies. For example, IIS is the web server for .Net web applications.
Java EE is actually a set of specifications (which is a fancy word for a bunch of interfaces and orders, how to implement them) that define how you should write your Java application and how the provider should implement its application server so that they can work together. The โcontainerโ mentioned here is the Java EE name for the provider application server.
You said you learn to write JSP. When you write JSPs, you are actually implementing a specification that defines how to write a Java EE mapping component that can be translated into HTML. Your application server (Tomcat / JBoss / BEA independently) knows what to do with your JSP to create the HTML you want and then send it to the user.