Aragorn, the king of human full of courage and insight, was once living in elves' land in his youth, and was quite familiar with the elves, and had never lost when wandering. Legolas, the prince of elves filled with nimbleness and agileness, immortal life gave him chance to know many generations of man, so he knew the real identity of Aragorn, but he had always been in the vast Mirkwood.