Understanding Popular and Recent Search Result Logic

On what basis do the results fall under the Popular Searches and Recent Searches?

The information for search queries is collected on the Magento side and can be found here: Magento Admin Panel → Marketing → SEO & Search → Search Terms.



If the query is new, a new entry will be added; after each use, the number of 'uses' is increased. All these queries can be found in the search_query table. 

When it comes to Popular Searches, these are the most relevant queries sorted by popularity from the same search_query table: