It's a saying that means: one person's traits are soon recognised by another person who shares those traits.
For example, a dishonest person will soon spot another dishonest person.
I might say "John is a dirty liar", to which my friend could say "It takes one to know one", meaning I'm probably a liar too.
Hope that helps.
- For Teachers