Under the covers the query execution is handled by...
# general
z
Under the covers the query execution is handled by sqlite. Osquery hooks up a bunch of "virtual tables" that generate output when it is requested by the sqlite query engine.