Dropping Targets
Do you use auto targeting and/or target promotion? (Press F11 to bring up the options screen in game.)
Another possibility is you could be accidentally selecting targets when right-dragging the camera during movement.
Autotargeting is not selected (because it’s annoying when I use a shout, say, and my character decides to start autoattacking the nearest mob)
Promote skill target IS selected, but I don’t really know what that does. The tooltip says “Automatically promotes targets to lock targets when selected.” I don’t know what that means.
If you have Promote checked, then that’s about all you can do. It could be that you are accidentally “right-click targeting” with your mouse, but I think its also likely that the problem is due to an ANet bug which causes this kind of weird spurious target-switching that many people have noticed.
I have this annoying problem as well. I have yet to find a good fix for it, beyond what has been mentioned here.