Capitalism 101.
Why work harder if you can work smarter without ever breaking a sweat?
Producing a song takes time so does writing a song from scratch. That's if the material isn't subpar, to begin with. In fact, it is an accepted truth that the more millions you make from anything, the higher the chance that you will lose the drive to continuously pursue your passion.
You won't be hungry like you used to from the start and this happens in every business (it's pretty much human nature)—the music industry isn't an exception either unless you are into audio mixing and mastering, you can't outsource that quite easily, you have to do it yourself for best results.
Nevertheless, as a songwriter or music producer, you could always lend your brand name to upcoming record producers and songwriters. In return, their music gets more attention and recognization than it wouldn't otherwise have gotten if it wasn't for you.
Hence, you probably might have heard of songwriting sessions or songwriting camps aka songwriting sweatshops to be precise... hahaha!
But hey, it's just business to demand songwriting credits alongside music publishing royalties so it's nothing personal—take it as you will. And if you are a newbie into the music business bothered by that fact then too bad... because that's every major artist's modus operandi.
In a nutshell, there are numerous ghostwriters and ghost producers behind so many songs. The A-List artists, producers, and songwriters can go on a vacation while the songwriting sweatshops are busy cranking out new material for them to either accept or decline to record.