The user input to ZAP comes from a conventional HTML form. The form action type may be either POST or GET, although we generally prefer the latter for this type of application (particularly if it is desirable for users to bookmark the results of a query or the reference to an individual record in a database). Of course, GET URLs may also be specified outside of forms, thus enabling static links into Z39.50 databases fronted by ZAP.
The output that ZAP sends back to the browser is always based on the content of a "template file". This file, basically, contains the bits of HTML which is to be output under different circumstances (ie. at the beginning and the end of the page, when the search fails or succeeds, when records are retrieved, etc.).
Either the form-parameters to ZAP, or the template file may supply parameters to the operation (ie. query terms, database names, formats, etc.). The template file may be set up to supply defaults, or to override the parameters supplied by the form (e.g. to keep users from specifying random targets to access).
Once the user input and the template have been digested, ZAP executes the requisite operation and returns the results to the user formatted according to the template. In the current version of ZAP, the default operation is implicit "Open connection, perform search, get records back, display records". ZAP can however also do a scan. ZAP is under constant development and other types of operation may be included in the future.