I believe it uses logic that becomes increasingly more generous when it doesn't find enough results.
If you search for "cava", the top results would be something like "cavalier". However since there aren't many items meeting that criteria, it becomes a little more lenient. For example, "caravan" would likely show up below cavalier since all the letters in "cava" are in "caravan".
If you have any specific examples where searching for something doesn't show up when you would expect it should, that would be helpful feedback to improve search.