SQL using 1,2,3... referencing arguments

I am in the middle of SQL intermediate training and my code was not working and I want to make sure i understand why it does not work.
’why do this work vvv

SELECT user_id,
SUM(watch_duration_in_minutes)
FROM watch_history
GROUP BY 1
HAVING SUM(watch_duration_in_minutes) > 400;

but not this vvv

SELECT user_id,
SUM(watch_duration_in_minutes)
FROM watch_history
GROUP BY 1
HAVING 2 > 400;

Basically because HAVING is processed after GROUP BY, which prevents using aliases (source: [1]).