What is a query?
If a URL is a postal address, the query is you ringing on the doorbell and asking a question.
Sometimes you need to ask the web page a question and it gives you back an answer.
Searching Google is a great example: the query contains the question you're asking.
In other cases the query string contains data the page needs. Sometimes data from forms is sent in the query string.
It's optional. If a page has no search or doesn't depend on data, a query string isn't needed.