Why is exchanging these knights the best move for white? I'm trying to understand how to get better with strategy and tactics.
Despite the difference in evaluation, e4 is not really a mistake. White is a rook ahead and will win this game anyway, provided that they don't blunder. Perhaps Nxc4 leads to a victory a few moves faster, almost within the engine's search horizon; that's probably why the engine prefers it over e4.
However, even humans should prefer Nxc4. If you're this far ahead, you should exchange material; every exchange means less chance of threats from your opponent. A two-to-one advantage is much more decisive than an eight-to-seven. Black's knight is also more active than White's, that's another reason to exchange it. (That the engine indicates that Black should exchange knights after e4 is surprising, but it only underlines how bad Black's position actually is.)
The advice about exchanging when you're ahead is of course not a rule set in stone. You should always keep in mind the (potential) activity of the exchanged pieces. And if you're only a pawn ahead, that doesn't need to be decisive enough for the win. Rook endgames and endgames with opposite bishops are notoriously drawish, and there are more examples out there, but you don't have to worry about them for now.
Look at the engine line! After your move, black voluntarily exchanges knights and plays ...f6, trapping your dark squared bishop. Now, white is still completely winning since you're up so much material and I don't see a direct way for black to try and win the bishop, but you're allowing black unnecessary ideas.
Instead, the suggested best line to play f4 after an exchange of knights forces Nf6 as there's no other way to defend the knight for black. Now you can trade bishop for knight, trading down even more material and getting you closer to a completely winning endgame. (You could also go Bxc4 first like the engine suggests, then trade the h8 bishop for knight later.)
This answer is not comprehensive, the other answers also raise excellent valid points, of course.