Two knights can absolutely give mate. Here is one, and it is a perfectly ordinary looking position.
8
So why does every endgame book call this a draw? Because Black had to be standing on h8 for that to work, and no sequence of White moves can make him go there.
The square you need is the square that draws
Now take the d6 knight off the board and look at what is left. This is exactly what you get while the second knight is still trekking across the board, because the king and the first knight are what does the pushing.
8
That is the whole tragedy of the ending in one picture. The knight on f6 and the king on g6 have done their job too well: the black king has no square, and no check. Draw.
To turn it into mate you need the second knight to arrive on f7 with check, and it takes several moves to get there. During those moves the black king must be allowed a square to stand on, and if you give him a square he uses it: he steps to g8, then f8, and he is out of the corner. Cover the flight, and it is the position above. Leave the flight open, and he runs. There is no third option, which is why the ending is drawn against any defender who simply refuses to sit in the corner.
The exception with a pawn on the board
Give the defender a pawn and the logic breaks. Now he always has a legal move to make, so the stalemate escape disappears, and if that pawn is far enough back for you to blockade it with a knight, the mate can genuinely be forced. The set of squares where this works is called the Troitsky line, and the resulting positions can take more than fifty moves to win, which makes them a curiosity rather than something to study.
For practical purposes the rule is simple. If you have two knights against a bare king, offer a draw and get on with your day. If you have two knights against a king and a blocked pawn, do not capture the pawn.
None of this stops a knight from being a lethal mating piece with help. A knight is the only piece that can mate a king surrounded by its own army, which is what a smothered mate is, and it pairs with a bishop into a mate that can be forced, just about.