How does a JSP gets executed?

The first time you call a JSP, a servlet (*.java) will be created
and compiled to a .class file. The class file is then executed
on the server. Output produced by the servlet is returned to
the web browser. Output will typically be HTML or XML code.