My hunch is they had to go through lean times to be able to focus harder on customers and eventually create a product that could take the company to an IPO. If you’re not lean, management is most likely distracted with the internal company and organizational overhead than you are with external customers.
No way to prove this (because we can’t recreate the exact scenario) however.
Investors do not decide who "deserves" more money, they decide who GETS it.
Deserving is more a moral term and makes things confusing: a company could deserve the money but not get it because they are not good enough at fundraising, or they need the money at a time when money is very hard to get etc. And many companies get money without deserving it because some investors are stupid, or because they are way too good at looking shiny.
I also get what you're saying though, in terms of the companies that deserve money are the ones that can convince investors that they deserve money.
If investors knew the company was going to sell for over a billion dollars, would they really not have invested? Maybe this is the case, but it doesn't seem like it. Instead it seems like the investors didn't believe the company would actually sell for a billion dollars based on the growth rate to date.