The main reason the NG did so well is that the NG plus A320ceo combined market over the last 20-odd years bought, what, 12,000 or more aircraft. And the NG and 320 were the only two games in town. McDonnell Douglas products were obviously on their last legs.
The driver behind the NG development was the same as that of the Max - the 320 was really scoring in North America. Northwest started it and United followed as key drivers, but early sales also to America West and Air Canada, and even to Pan Am and Braniff before these two went under, coupled with a very obvious forthcoming expected peak in replacing 3-crew/3-engine 727s, the traditional general-purpose workhorse of US carriers which would be coming to the end of their time, made Boeing feel the market was slipping from them. Probably quite rightly.