I will explain in SIMPLY CONDITIONS as follows.
Refer to this image for the following explanation:

Task: select a function that will track the correct angle in the range -180 < θ < 180
Test 1: sin() positive in the first and second quadrants, sin(30) = sin(150) = 0.5 . Tracking a quadrant change with sin() will not be easy.
Therefore, asin2() not feasible.
Test 2: cos() positive in the first and fourth quadrants, cos(60) = sin(300) = 0.5 . In addition, it will not be easy to track the change in the quadrant with cos() .
Consequently, acos2() again is not feasible.
Test 3: tan() is positive in the first and third quadrants and in an interesting order.
It is positive in the 1st quadrant, negative in the 2nd, positive in the 3rd, negative in the 4th and positive in the wrapped -1th quadrant.
so tan(45) = 1 , tan(135) = -1 , tan(225) = 1 , tan(315) = -1 and tan(360+45) = 1 . Hurrah! we can track the quadrant change.
Note that the unambiguous range is -180 < θ < 180 . Also, note that in my example with a 45-degree increment above, if the sequence is 1,-1,.. angle goes counterclockwise, and if the sequence is -1,1,.. it goes clockwise. This idea should decide the direction.
Therefore, atan2() becomes our choice .