That's how the USB-C to 3.5mm adapters work for if you need to use headpones which don't have a USB-C cable.
A lot of USB-C cables have little ICs built into them. It's required as part of the PD spec. A port isn't supposed to provide a laptop with 60W or whatever unless the cable itself communicates that it's rated for it.
My current phone is a pixel 6. I got a USB-C adapter with a DAC built into it, and it actually sounds pretty good. The volume levels are reasonable, and there's no noticable noise other than perhaps an unnoticeable hiss.
Years ago, I had a desktop case front IO panel with a really bad ground loop. I ended up cutting the molded over plastic open and cutting the PCB traces between the audio ports and the USB ports, and the problem went away.
Also USB can do analog audio supposedly...