From there it either plays out one of two ways depending on how competent the management of the incumbent is.
1. They underestimate and continually disregard the startup. This generally leads to AMD vs Intel situation. Don't do this.
2. Understand the threat they pose and systematically match all of their advantages, smothering them with investment they can't afford to keep up with. This is essentially what Epic did here and generally what you should always do if you have a dominant market position and can afford it.
Unity is left in a bad situation because accessibility to their engine was it's key draw. A few years ago people also felt it was an easier engine to develop games on but that viewpoint has been shifting back to UE4 as of late because of the difficulty studios have had "actually shipping" Unity based titles, let along long-term maintenance issues. In terms of pure quality Unreal has generally (but not always) been on top and definitely in terms of capability and performance.
Doesn't help that Epic has an enormous cash-cow in the form of Fortnite while Unity has next to no income outside of it's in-game advertising business. They also bet heavily on VR and that hasn't panned out to be as profitable as people thought it would be with the majority of revenue in the VR/AR space being heavily skewed into the enterprise, government and military verticals which aren't where Unity performs well.