Controlling Files/Applications selection in the Dash

I love the Unity desktop (currently running Ubuntu Unity 22.04). But one thing I’ve never figured out: sometimes when I do a search in the Dash, the results only show files, sometimes only applications, and sometimes both. Of course, I can change this by clicking on “filter results” and then on the buttons shown.

But can someone please explain to me how to control this apparently erratic Dash behaviour?