Moodle is a web application running typically (but not exclusively) in a web browser. A Moodle user interacts with a user interface on a client computer. The client requests resources from the application server (generally known as middleware) that provides the requested resources. It can do so by calling on another server, known as the data server. The data server provides the application server with the data it requires:
Check out https://en.wikipedia.org/wiki/LAMP_(software_bundle) for more information on the stack.
Generally, this architecture is referred to either as a WAMP stack or LAMP stack, ...