On the ATmega328P (the microcontroller of the Arduino Uno), the AREF pin is initially floating. If you try to read its voltage, you can get basically anything.
As soon as you select an analog reference other than EXTERNAL, the
AREF pin gets internally connected to either the AVCC pin (if you select
DEFAULT) or the internal 1.1V reference (if you select INTERNAL).
This typically happens when you call analogRead() or, in your example
code, when you set the REFS0 bit of ADMUX.
Edit 1: As pointed out by JRobert in a comment, the section ADC Voltage Reference of the ATmega328P datasheet is worth reading if you consider using the AREF pin. Especially the warning in the third paragraph.
Edit 2: Answering this new point:
AREF can only output a voltage when used by the ADC, but not when used by the AC.
Whether or not it is being used by the ADC and/or the AC is irrelevant
to the behavior of the AREF pin. The only thing that matters is whetherthe
or notvalue of the REFS0 bit of ADMUX is set. The pin outputs a voltage if and
and onlyonly if that bit is set. This can be clearly seen in this part of the
schematic of the ADC, from the datasheet:

When REFS0 is 1, the transistor circled in red connects the AREF pin
to either AVCC or the internal reference, as selected by the multiplexer
controlled by the REFS1 bit.
Note that you can change this bit without ever really using the ADC, although that would probably be useless.