Knowledge is different from wisdom. Where wisdom emphasizes the things of God, knowledge emphasizes earthly learning. Just as one may have a gift to teach the things of God, one may have the gift of teaching the understanding that comes from human sciences. Information may come from either source and both may be true. The gift here is in the teaching, not in the possession of either type of understanding. We may all understand both, but the gift of teaching by the Spirit is given to fewer.
Reference: This phrase comes from 1 Corinthians 12:8 where it follows the gift of teaching the word of wisdom, just as it does here. The similarity of language and parallel structure confirm that 1 Corinthians is the source for Joseph’s redaction of Moroni’s text.