Filtering vs. searching
In the question of filtering vs. searching it's about context I think.
Filtering would happen in a list for example in the current view, while searching reaches across multiple views.
If we would take mail as an example, I think you would want to search across all directories you store mails in.
An example for filtering could be your contact list. You filter on your "search" term, narrowing down your contacts to a list with contacts named "John".
Same window vs. new window
The search in a new window you mention at first is actually an overlay that covers the current view. This is done because the search in your example wants to show recent search terms or might show autocomplete results. Imagine these autocomplete results being placed on top of the current view without any background... On mobile, because of the little screen real estate available, the overlay fills the entire screen. On larger screen this might only cover a small portion of the screen.
Filtering can be done in the same view, because you're removing unrelated items from the list in real time (while typing). The result is the same list, but filtered. Whereas the result from a search are (possibly) completely new items.
Advantage using one over the other?
This will depend on the context (your application) and what will give the best user experience in your situation (based on your assessment as an UX expert backed up by some testing).