A potentiometer (the component behind a volume knob) is simply an adjustable voltage divider. Turning the knob slides a contact along a resistive strip. This effectively splits one large resistor into two smaller resistors (R1 and R2) in series.
Inside the Device
9V
R1: 5 kΩ
R2: 5 kΩ
V_out
User Interface (Volume)
Vout = 4.50 V
Slide to change the tap position.
Elaborative Interrogation
Think about it: Why does moving the slider down make the volume lower?
Because of the Voltage-Divider Rule: Vout = VS × R2 / (R1 + R2).
Moving the slider down decreases R2 (the resistance below the tap). Since R2 takes a smaller slice of the total resistance, it takes a proportionally smaller slice of the 9V source. Less voltage means a quieter speaker!