.war - web archive. used to deploy web applications according to the servlet model. It is a jar file including a special record called WEB-INF and several files and directories inside it (web.xml, lib, classes) as well as all the HTML, JSP, images, CSS, JavaScript and additional sources of the web application
.ear - enterprise archive. It is used to extend enterprise applications including EJBs, web applications, and 3rd party libraries. It is additionally a jar file, it has a special record called APP-INF that contains the application.xml file, and it includes jar and war files.