Being a real composer or lyricist wasn't strictly necessary to get credit for writing a song.
Irving Mills (who probably wrote an actual lyric or two) was the front man/manager par excellence. His deal with Duke Ellington was to manage and promote the band in exchange for half its earnings, including Duke's composer royalties. This sounds like a raw deal, and many critics have pilloried Mills for it. I see it differently: Mills worked like the devil to put Ellington's name and music before the public. He got Duke on practically every record label, into the Cotton Club and in other high-profile venues where no Negro band had ever worked; on network radio and on film, all by 1929. If this meant he got co-credit for all Ellington compositions, I say Irving earned every penny. He did the same for Cab Calloway, and business was so brisk for both bands, right through the Depression, that a third-string (but decidedly NOT third-rate!) group, The Mills Blue Rhythm Band, was formed to take up the slack. In any case, for an alternate universe peek at Ellington's career without Irving Mills, consider that of Fletcher Henderson.
Al "The World's Greatest Entertainer" Jolson earned co-composer royalties for songs like "Sonny Boy," "Avalon" and others, simply in exchange for singing them. In the 'teens and 'twenties, a Jolson performance and endorsement made a song's success as sure a thing as possible in the music business, and songwriters were agreeable, if not exactly overjoyed, to give Al a slice of the pie.
Jolie actually DID come up with the idea for "Sonny Boy." De Sylva, Brown and Henderson had already written the score for The Singing Fool, Al's second talkie feature for Warner Bros. At the last moment, when Al was about to leave for the coast, he popped in and said, "Listen, fellas, I wannanotha song, something sentimental, about a kid. Put a line in it like, 'Climb upon my knee, Sonny Boy.' See ya!" D. B. & H. scoffed and scowled. They were already sick and tired of this project, and of Jolson. Then someone said, "I know what - let's write the WORST SONG EVER WRITTEN! That'll show him!" And so they did, howling with laughter over every increasingly dire line; then they sent it west, Special Delivery. Jolson phoned from Hollywood: "It's perfect! It's just what I wanted!" - and Jolson, De Sylva, Brown and Henderson each made about a million bucks from what proved to be the most successful song of their careers.
This only goes to show that a) sometimes non-musicians and non-lyricists earn their keep as co-writers; and b) you can never underestimate the taste of the American public.