What is meant by quality?
Just to build on what others have said…
If we’re talking about CD vs vinyl, it’s a matter of opinion which sounds better. I personally think CDs have the best sound quality, but a big reason vinyl has made a comeback is because many think it has a better sound.
Of the few comments to this simple question I posted most deviated from the physical media discussion to bring up digital file formats, and only one mentioned low quality headphones.
It wasn't a real question, it was a feeler. Because one thing I have learned over the years is that in general, the (physical) format doesn't actually matter. The quality of the equipment is what matters. Everyone hears differently as well, but even so, all sound can be fixed by equipment and environmental acoustics.
The only issues with (pressed) CDs I have encountered are with modern CDs that have clipping present, which indicates that the mastering source was digital. General illustration of what clipping is: