When the team that has batten twice but has not scored more than the other team's first innings score, then it is called "win by an innings.
As info, each team has to bat twice, but if the losing team has not surpassed the single inning total, despite batting two times, and lost all the wickets, then it is called "win by an innings".