CD ripping being Illegal is so weird

So downloading music from 7digital and putting them on Jellyfin is legal. But ripping music from a CDs is not?

From what I understand it's not enforced that much. But still I legally purchased some music. But because one being a digital download and the other being from a CD. One method of doing the same thing with that music is technically illegal?

It's almost like copyright law is just complete bullshit