The border is a background, not a border color. The button has two backgrounds: a solid fill clipped to the padding-box, and a conic gradient clipped to the border-box. Since the border itself is transparent, the gradient only shows through the 2px border ring.
The rotation comes from @property. Registering --angle as an <angle> lets the browser interpolate it from 0deg to 360deg, which an ordinary custom property can't do. The glow is the same gradient on a blurred ::before behind the button, and it brightens on hover and focus.
With reduced motion on, the gradient rotates four times slower. Browsers without @property support show a static gradient border, which still looks fine.