Sometimes you need to use an item on an object, so first you make that item the current item by positioning the mouse cursor on it. Then you position the cursor on the object, open the inventory, press Enter, close the inventory, and click of the object.
However, if the inventory covers the object when you open it, by opening the inventory while the mouse cursor is on the object you'll position the cursor on an item, meaning that pressing Enter will select this item instead of the item you'd like to use.