Once they know you're connected to Youtube, they just limit the bandwidth on that connection. The Youtube video player will detect this and automatically downgrade to a lower quality until it finds one that fits within the bandwidth profile. Netflix does the same thing, which is why after buffering sometimes the video looks like crap and then gets better after 15 seconds or so. It buffered a lower quality until it figured out it could send higher quality again.
EDIT: I should add, this is why VPNs are sometimes used as a "solution" to such bandwidth shaping. You are hiding the true recipient by purposefully man-in-the-middling the connection with a peer you (hopefully) trust. VPNs are also popular for connecting with business networks, so it's generally not "safe" for the ISP to shape bandwidth to any VPN as aggressively.
Ahh, this is the key point I missed, thanks. So it's a problem with the video player itself trying to "decide" for you the quality you want. Couldn't this be worked around with things like youtube-dl?
Youtube-dl would probably work, because it will would download the high quality video as a file, and your ISP would make the download take longer than the video.
It's an extremely annoying thing actually, especially when it changes after I manually set it to 1080p. This is why I use mpv to watch stuff from youtube nowadays.
I'd imagine this is due to politics and AT&T betting net neutrality will go away. Once YouTube forks over money a peering point will be upgraded.
[1]https://forums.att.com/t5/AT-T-Fiber-Equipment/Gigapower-You...