Merkava it's select the first enemy,npc that you have selected in your auto-lock options. If you go out of range your ship will have still locked the enemy/npc out of range so if you try to attack a new enemy/npc that you see near you need to press shift+z (or try TAb) or select a new enemy manual