When you click on the button, a request is sent to the WebServer. After some time, the response is received and used to update the text field. The actual response is created by a Servlet running in the WebServer.
When Submit is pressed, the AjaxAnswer Servlet is invoked - behind the scenes, asynchronously. When the response is received, the JS Function processReqChange() will update the field.