The way CYA protects chlorine from UV is that a large portion (like 95%) of the free chlorine (FC) attaches to it, where it is protected from UV light, but also hasn't any oxidiser or sanitiser effect anymore, but unfortunately stills shows up as FC in the test. That's why it is important to adjust the FC-level following TFP's recommended
FC/CYA Levels.
The advantage of this is that the chlorine that is attached to CYA doesn't bother anyone, it doesn't feel harsh or aggressive to swimming gear or pool equipment. It is a nice reservoir of chlorine, as the actually "active" part of FC (the 5% that aren't attached to CYA) gets lost doing its job killing nasties and oxidising bather waste.
This makes a residential pool much easier to manage. From above linked FC/CYA chart you'll see that for
CYA 30, we recommend an FC target range of 4-6ppm, and never fall below 2ppm. Up to SLAM level (used to clear an algae infestation), which is FC 12 for CYA 30, is safe to swim.
Without CYA, above target range would be equivalent to around FC 0.15 to 0.2ppm, never fall below about 0.1ppm. SLAM is equivalent to 0.64ppm. These ranges are difficult to maintain in a residential setting. Just one kid mistaking your pool with bath room can be enough to wipe out all of the FC. But maintaining higher levels makes the water feel very unpleasant.
That's where a bit of CYA in an indoor pool makes a huge difference. You can maintain say 5ppm of FC, but the "active" portion is only about 0.15ppm. If you lose those those 0.15ppm, it gets replenished from the "reservoir", and you have effectively only lost 0.15 out of 5 ppm (a 3% loss) rather than 0.15 out of 0.15 (a 100% loss).