The json_query facility provides a way for client applications to query the database over the network. Instead of constructing its own SQL, the application encodes a query in the form of a JSON string and passes it to the json_query service. Then the json_query service parses the JSON, constructs and executes the corresponding SQL, and returns the results to the client application.
This arrangement enables the json_query service to act as a gatekeeper, protecting the database from potentially damaging SQL commands. In particular, the generated SQL is confined to SELECT statements, which will not change the contents of the database.
In addition, the json_query service sometimes uses its knowledge of the database structure to supply column names and join conditions so that the client application doesn't have to.
Nevertheless, the need to encode a query in a JSON string adds complications, because the client needs to know how to build the right JSON. JSON queries are also somewhat limiting – they can't do all of the things that you can do with raw SQL.
This tutorial explains what you can do with a JSON query, and how you can do it.