It's not though, that's a common misconception and one of the reasons ringworlds are described as unstable. A ring with its center of mass the same as the star could very well be spinning without being in orbit at all.
In fact, if you match the spin with an orbital velocity so that it doesn't crush itself, you don't get enough inertia to generate appreciable artificial gravity.
If you increase it further to try and get 1g on the interior, and the thing will be flinging itself to pieces and no longer at a stable orbital velocity.
And all of this, even if you build it out of handwavium so that destruction doesn't matter, the thing still isn't actually in orbit, not any more than throwing a ball at the ground technically puts it into orbit.
Orbits are generally understood to be at least partially stable configurations where the center of mass of one object moves around the common center of mass for a system. A star with a ring around it really isn't describing what we'd call an orbit, it's just sort of ... overlapping. The COM of the system and the COM of each object is the same. And once any outside force causes them to no longer overlap, the system will continue to topple in that direction. It really just ... not an orbit in the ordinary sense of the word, it's more like a gravitational equilibrium.