Neighbor Joining is a distance matrix method used to build phylogenetic trees by relying on genetic distances between species. The algorithm works by iteratively joining the pair of taxa that minimizes a matrix of distances, treating the tree building problem as an optimization problem to find the tree that best fits the observed distances. It outputs an evolutionary tree showing the inferred divergence of species based on analyzing molecular differences, under the assumption that the tree is additive.