It took 2 rounds, because they were in a boxing match. If they were in a 'real fight' like we're talking about, it would be over in 30 seconds. They would both start throwing punches at each other, Joshua would be far better at it, and Ngannou would be out cold before he even had time to remember that he's a UFC champ. Even if he was still conscious after eating one, and tried to clinch and grapple, I'd imagine Joshua would just shake him off and hit him a couple more times, and that's that.
When people fight for real in the heat of the moment, even trained fighters, its usually just a bunch of fists being thrown. Look at DC and Jones going at it, or Chiesa and Kevin Lee at the press conference, they are just throwing punches, they're not establishing range and thinking about what's the best gameplan. A boxer like Joshua would chin all these guys in that kind of scuffle.
That's all assuming Ngannou just picks a fight with Joshua not knowing that he's about to fight one of the best boxers in the world.