In Star Trek: The Next Generation, we see type 2 hand phasers used as the primary firearm used by most Starfleet officers, citizens of the federation, and basically anybody who could lay their hands (or tentacles, claws etc) on one.
In the following pictures (which I got from Google, and claim no right to), we see how the phaser beam often comes out at different angles to hit the target:
This would imply that these phasers have an automatic target-acquiring system, that changes the angle of the beam depending on what angle it is being held.
However, we also see phasers being fired, and the beam coming out in a straight line (i.e in the same plane as the nozzle, for want of a better word, of the phaser). On these occasions, and again, using the same type of phaser, the beam will miss by a matter of centimetres (as seen in these photos, which I again found on Google, and a photo from Netflix, to which I claim no rights):
The same effect is also observable on Cardassian and Romulan weapons.
My question is: do phasers (or disruptors) have an automatic targeting mode?
An in-universe answer is preferable, but any out-of-universe answer would also be appreciated.