The Marx Brothers did not simply spring fully formed and start making movies. They had been around in vaudeville for years, on grueling schedules that often featured multiple performances a day, and often back-to-back days for weeks on end. They were, of course, responsible for writing their own material, so in those years they had to keep coming up with new jokes, new bits, and new songs.
Abbott and Costello, coming out of the burlesque circuit and endless shows for the USO during World War II, were in a similar situation. Constantly make up new material, keep what gets the laughs, drop what doesn't.
Essentially, they were using a refining process, like removing the impurities from iron ore.
They have decades of trial and error as to what works, what doesn't, and often tons of analysis and feedback from fans as to why. That's why you'd never see a Secret Wars 2 adaptation, even if they could get all the rights needed to do it correctly, but we are going to see a Civil War adaptation, which was received very well by most fans.
Obviously everyone's opinions are going to vary, and doubtless someone will pop up in the comments that liked SW2 and hated CW; such are the vagaries of taste; I'm sure someone out there is dying for a Dazzler movie to be made, and I'll be happy for a ROM Space Knight film, as long as it's part of a larger Dire Wraith invasion storyline*.
They don't even need to be straight adaptations of story lines. Even in terms of characterization, interactions between characters, themes, appearance/costumes, etc. they can see what worked and what didn't, and write the movies accordingly.
Now, even Marvel doesn't use this strategic advantage consistently, and there have been some shaky films to prove it (Hulk, for instance). But on the whole, I think their almost-universal success can be tied to that enormous reservoir of experience.
Fox has the same advantage with X-Men, and finally figured it out after four movies. It's no mistake that Days of Future Past and Apocalypse are being used, but House of M is not. Why Sony hasn't quite gotten the message is puzzling, but maybe if the rumors are true and some sort of Sony-Marvel alliance is still possible, that may change and we can get the Kraven's Last Hunt or The Night Gwen Stacy Died stories that we should have.
* I will also be content if Squirrel Girl is the one who finally takes out Thanos in Infinity War Part 2.