What is: Query
A Query is made to access data from a database. Or when you ask for some particular data from a set of data. The function of selecting, inserting, deleting and manipulating data from databases is also known as Query.
When you look for something in a WordPress web page or simply reading a blog, each time a query is being sent to the WordPress database to fetch the data. Also when a user creates, edits or deletes any data in a WordPress website then database queries run in the background to get the data from the database.
In WordPress, The WP_Query is a class to make custom queries.