Marvel is a big name now, so big that even an obscure property like Shang-Chi can get a film and people just assume it will be good.

That wasn't always the case. Marvel had instead been known for taking any sketchy deal where the check would clear. 

So when they decided they wanted to make their own films, and capitalize on the success of The X-Men (sold to Fox) and Spider-Man (sold to Sony), no one was really interested. The reasons were obvious; they had baggage and no good characters left. There were only B (Captain America) and C (Iron Man, Thor) level characters left.

They decided they wanted to make their own films, but they had to take a leap of faith - and that meant going to Merrill Lynch and asking for a line of credit. Marvel was still considered pretty shaky at the time - it had become profitable again, but only due to licensing. So a line of credit for $525 million that would be available over seven years if they hit their marks. Merrill Lynch got Captain America, Nick Fury, and the Avengers as collateral. True to Marvel's flaky rep, they had to use $10 million to pay Stan Lee - yes, that Stan Lee - because he had sued them for using accounting trickery to avoid paying him. It's impossible to speak any ill of him now but he was himself a master of the sketchy deal, so Lee got the kind of trick pulled on him that Lee would have pulled. 

Marvel is a New York City company and they wanted The Avengers to be a NYC film; but they had to take a big risk to get the money to do it.

With money in hand, they started getting talent and took a gamble on Robert Downey, Jr. playing Iron Man, a character few outside comics fandom could name. But even then they had the idea for a group film using the characters they had left: Iron Man, Captain America, Ant-Man, Nick Fury, Thor, and the Hulk (in agreement with Paramount, who owned the rights) - most of which were coincidentally The Avengers.

Obviously there was room for failure at every turn. Iron Man 2 was not well-received, nor was The Incredible Hulk, Captain America and Thor had not been released when they started work on the Avengers film. 

History won't be kind to most of the MCU films, the same way most young people can't figure out why Westerns were such a big deal 60 years ago, but $20 billion can't be wrong.