Pre_get_posts is an action hook that is called before the query is run. This allows developers to alter existing WordPress queries before they are executed and thus change what is returned from those queries.