When I rightclick an enemy army to attack, two things can happen.
Scenario 1: I have just enough movement to attack the enemy. If they are adjacent to my army and they are in a plains tile, I need 1 movement to attack. When I right click on them, I attack them and when the battle ends, my unit remains in its original tile.
Scenario 2: I have more movement spare. If the enemy is adjacent to me and they are in a plains tile, I have 2 movement in this scenario. When I right click on them, my army instantly moves into the same tile they occupy and I get the popup to attack the enemy. If I press cancel when the fight popup appears, my army still loots any goodiehut in the tile but I don't need to fight the enemy army. I can use this exploit to loot any goodiehut or monster lair guarded by the most fierce of enemies, simply by thinking ahead and cancelling a fight.