Angle between the minute hand and 12 o'clock:
$m/60$ is the percentage of the clock circle. E.g if we have $15$ minutes on the clock then $15/60$ is the percentage of the circle that the minute hand passed.
$360 * m/60$ simply means what percentage of 360 degrees (e.g actual degree) minute hand passed.
Angle between the hour hand and 12 o'clock:
Same logic applies here:
in $(h \mod 12)$ - we handle military time
$(h \mod 12)/12$ is the percentage of the clock circle
$360 * (h \mod 12)/12$ is percentage of 360 degrees (e.g actual degree) hour hand passed.
Angle between hour and minute hand:
Well, here is simple:
You have one degree and another degree
e.g $0$ degree hour hand and $270$ degree minute hand
then you take absolute value of their difference e.g $-270 = 270$
angle = abs(hours_degree - minutes_degree)
and then you take Math.min(angle, 360 - angle) because maximum angle is 180. I am not sure what programming language you are using, but you got the point.