You can focus any file by typing its name in MacOS.
However, the behaviour is somewhat weird. If your current selection is a folder, and you start typing, it's a 50/50 guess of where it will start the search: in the folder you've selected, or in the parent folder of your currently selected folder
Edit:
Reading other comments I now realise you meant the behaviour of Cmd+F which doesn't default to "search in current folder".
Thankfully, there's a setting for that now, added a few years back: Cmd + <comma> in a Finder window -> Advanced -> "When performing a search: Search the Current Folder"
However, the behaviour is somewhat weird. If your current selection is a folder, and you start typing, it's a 50/50 guess of where it will start the search: in the folder you've selected, or in the parent folder of your currently selected folder
Edit:
Reading other comments I now realise you meant the behaviour of Cmd+F which doesn't default to "search in current folder".
Thankfully, there's a setting for that now, added a few years back: Cmd + <comma> in a Finder window -> Advanced -> "When performing a search: Search the Current Folder"