The one relationship that immediately springs to mind, when I think of this type of thing, is Elton John and Bernie Taupin.
I understand that they split up for a while, and that Elton John's music lost its lustre during that period.
Although I like some of Elton John's work, I am not enough of a fan to speak in more than a fairly vague sense. I just remember people complaining about it, when it was happening.
Keith Reid was also given top billing, for Procol Harum. He usually showed up in group photos.
I'm sure it's not as cut and dry on every song necessarily but Elton writes the music and Taupin writes the lyrics. Of course EJ performs the songs.
Neither would be what they are without the other, certainly, the same as Lennon and McCartney's solo work was great but didn't come close to their collaboration.
Anyways just want to point out EJ isn't one of the "manufactured" pop artists who had others write his songs for him. He's a true artist and musician in his own right even though Taupin is obviously hugely important to his success.
https://www.amazon.com/Song-Machine-Inside-Hit-Factory/dp/03...
More commonly, at some point a different writer is brought in to update it, sometimes heavy rewrites, sometimes just tweaks. Once it gets filmed, the writer's guild has a process of arbitration to determine who gets credit, based on roughly who is believed to have contributed the most original material. The person or persons who are considered the primary creators get residuals based on % of money made (actual money made not the Hollywood accounting bullshit).
They also have very prominent credits, second only to the director (notice it's the second to last in opening credits or second if it's closing credits).
Their biggest issue is all the unpaid work they get asked to do. They can do months and even years of work without any compensation with projects that aren't really moving forward.