The class you should look into is Mage_Adminhtml_Block_Widget_Grid
There you have the method
this takes the product collection and obviously prepares it by setting the sort order, applying filters, etc
protected function _prepareCollection()
Then on line 509 you have
This variable contains the column you search into and the search query. It is base64 encoded.
$filter = $this->getParam($this->getVarNameFilter(), null);
After that, on line 516 the string is decoded into an array:
And finally the filters are added to the collection in _setFilterValues($data) method (line 449) and _addColumnFilterToCollection($column) method (line 463)
$data = $this->helper('adminhtml')->prepareFilterString($filter);
But even if you have this information it still won’t help you too much. The search on backend is faster because:
1. The product collection in the backend grid doesn’t include all the attributes.
2. You search into a specific column (not as you do on frontend in all searchable attributes)
Hope this helps.
(for refference, I used magento 1.8 in this example)