Once upon a time there were add-ons created to cast spells and use abilities when a hotkey was pressed rather than released. This was largely PVP driven where those few (hundred) milliseconds matter. Of course this was also useful for PVE and I think healers were the first to catch on. Now your mouseover healers (which most healers are) enjoyed the benefits of this right away, but those healers that click on their targets had a slight glitch.
Clicking on a raid/party/unit frame, or any friendly/hostile unit directly, sets your target when the mouse button is released, not when the mouse button is pressed. So as you can imagine, or perhaps as you have experienced first hand, it was very easy to begin casting a spell prior to your new target being selected, negating the benefits of those faster, more responsive, hotkeys.
So the next part of the arms race, largely for the benefit of healers, raid/party/unit frame add-ons added the ability to change your target when you pressed your mouse button instead of when you let go. Life is good again.
Fast forward to the present day; Blizzard finally saw the benefits of having hotkeys work when pressed rather than released, and added the option into the game by default. Sadly they did not see the big picture and the default frames still switch targets when the mouse button is released.
I have recently exposed a new and annoying wrinkle in this arms race between ability usage and target selection when tanking. Often times I will flip targets quickly to taunt, interrupt, or use a ranged ability like faerie fire, but since my target is changed when I release my mouse button I often end up taunting my current target and wasting the cooldown.
Interrupting worshipers on Cho'gall and taunting down spinners on Beth'tilac are just a couple examples of situations where it would really help to flip targets on mouse down rather than mouse up. Unfortunately I'm not sure there is an add-on to do this, or at least I don't know of one yet after searching for a while.
One day target selection and ability usage will consistently use either the key/button pressed event rather than the key/button released event, but in the meantime the left hand will never quite know what the right hand is doing, and vice versa.