Material problem: Scaling Ring Mask

Hi, guys
I am learning how to make a scaling ring effect from an article (link: ), now I have seen how to make a Scaling Sphere Mask (the material on the left side of the picture), but the material on the right side of the figure is on the left Based on the addition of a distance node, a Scaling ring effect is generated. I can’t understand why the Distance node is used to make the ring effect. Who can help me understand, thank you very much!