Say the OP is using an mp_grid and pathfinding to go to the "nearest object", as returned by 'instance_nearest'. That command only looks at distance, so it could return an object that is very close, but due to walls of a room and doors etc is actually much farther to reach.
'Instance_nearest' does not have any further refinement based around actual access to the object. So if you wanted the closest object in terms of distance traveled to it, unfettered by other objects like walls etc, then 'instance_nearest' would be useless. You could be standing next to the room that the food is in, only separated by a wall, but the access to the room is way beyond the object itself - the command doesn't know things like that.
You can't cycle through 'instance_nearest', which is why people make scripts for sorting objects....since it only does one thing - show you, without any other considerations, what is closest.
PS:
According to FrostyCat - using WITH is less costly than using a FOR loop going through 'instance_find'.
So if you do have other criteria, beyond just how close the object is, then you will need to go through all the other instances somehow, and WITH is apparently the best way.
If you don't need any other criteria than distance, then 'instance_nearest' will do just fine.