King's Indian Defense - Black Knight (on f6) moves

It depends on the variation-line you play. Sometimes Nh5 is not possible because of the battery Qd1-Be2 threatening to capture on h5 when its needed to play Qe8 first. In the classical Petrosian system with an early d5, there is a line where Black plays Kh8-Ng8! in order to relocate the knight or even to support a Kingside expansion and a trade of dark square Bishops. When the center is closed trading dark square Bishops is useful for Black.
Ne8-Nd7 are more common in the Mar del la Plata-Bayonet (but not only, I have seen a lot of such moves in the Makagonov) when Black is aiming for certain setups and knight maneuvering. Plans are those that define where the f6 knight will go. If you want to play with both knights on the Queenside then Nd7 is your option. Everything depends on plans that's why you have to know some theory and study games.