The Query tab is used for agents (and smart adornments) only.
The main input box is used for adding or editing a query ($AgentQuery). Pressing the Return key commits any changes made and runs (or updates) the query. The code box has auto-completion for action code and attribute names (based on using a $-prefix).
The number of items currently matching the query, i.e. the child count of the agent is show at top right.
Case insensitive. If ticked (the default) any comparisons of string values are case sensitive [sic]. This setting is effectively a legacy compatibility control. This is best left as default and sensitivity controlled by choosing use of .contains() versus .icontains() as appropriate. Sets $AgentCaseSensitive.
Note that an agent's query, action and priority can also be set from the agent tab of the Get Info pop-over.