Saturday morning cartoons (He-Man, GI Joe, Transformers, etc) . . . the cartoons themselves didn't generate a lot of income, although they did generate some through advertising, they were definitely designed to be loss leaders driving toy sales. But even then, the creative folks behind those cartoons were artists creating products that expressed their own artistic impulses (within the constraints of their corporate masters) and hoped that folks would take joy out of their work.
An interesting dimension to this is that the creative teams of long-running franchises have in many cases shifted over the decades from the original creators of these works to the fans who grew up with them. Since I've already brought it up here, I'll use the Archie Comics Sonic the Hedgehog series that ran for 20 years as an example.
The original team for the comics had most recently worked on a tie-in comic for the TV show Alf, and when the Sonic comics started they were full of puns and in no way serious. Another writer came on later who wanted to incorporate aspects of one of the then-cancelled Sonic cartoons, leading to the comic to gradually shift in tone and setting details to become essentially an alternate continuity version of the more-serious, cancelled cartoon.
While all these people were passionate about their work, they weren't necessarily Sonic the Hedgehog fans. The IP was only years old with almost no official lore and little direction coming from the IP holder, Sega. It became a playground for the comics writers and led to all sorts of strange details, lore, and homages to both fantasy and superhero media that would be completely off-the-wall to a kid who likes Sonic the Hedgehog today, now that the games themselves actually have stories and established lore.
However, eventually the creative staff for the Archie Comics Sonic series began to phase out as the comic ran for much, much longer than anyone expected. From 2006 to the series' cancellation in 2016 the lead writer in charge was Ian Flynn, who previously had a letter published in the fan mail section (that criticized certain writing choices of the then-current lead writer) of the comic years before getting the job. As a fan of the Sonic franchise in general who was in touch with the online fan community, Flynn knew what he and other fans wanted to see in the comics and made many changes while also trying to accommodate the IP holder, Sega, in their request that certain details of the comics' by then decade plus lore were brought more in-line with the details that had since been established in the games. Flynn and other Sonic fans took over the series until its cancellation due to tensions that had developed between Sega and Archie Comics, at which point Flynn and most of the Archie Sonic creative team were hired-on to create a new, still-running Sonic comic for IDW, one that was unable to retain the original lore of the Archie comics.
To tie this to D&D, once an IP has gone on long enough the creators start to get replaced by fans who grew up with material (and as such may have more reverence for it). However, even these new creators must follow the mandates of the IP's owners.
As far as canon is concerned, Ian Flynn was very concerned with maintaining and drawing upon it during his decade as lead writer on the Archie series while also adding new ideas. Although he wasn't the only writer on the comic, he was a force to maintain canon and draw upon it while forbidding retcons. His ability to maintain a consistent canon was enabled by the fact that he was the lead writer for one specific branch of an IP whose owners tolerate other continuities (as evidenced by the fact it has had five cartoons over the years with separate continuities and wildly divergent lore between them). This makes the job more manageable as Flynn doesn't have to know all Sonic the Hedgehog canon, but just the canon relevant to his slice of the IP's media adaptations.