Modern multitier software architecture allows us to separate concerns when we are building a web application. For example, when there is a request to visualize a content item in Drupal, the request is handed off to a logical handler (module), which should be using some kind of API to read the necessary data from the database. And once it has assembled that data it should invoke the theming engine and its current theme in order for the final output to be rendered all ready to be sent back to the browser that made the request in the first place.