This is a really good question.  I'd think that they both come from the same root - they have the same origins.  Before you can stereotype, you need to know someone's identity.  Then you need to apply that identity to other people with the same characteristics.  Keeping in mind that not all stereotypes are negative, this is a nice way to link the two.