A hate crime is, in many ways, the same as any other criminal offense. An assault can be a hate crime, for example, as can arson. The difference simply lies in the motive behind the crime.
For it to count as a hate crime, there needs to be some bias against the person who was victimized by the crime, and the crime needs to have been carried out because of that bias. In fact, the bias itself is often the reason that the victim was chosen. In all other ways, the crime might look like a completely random event.
For example, if someone is assaulted while on a walk in the park by another person he or she does not know, it could be a random attack, an attempted robbery, a case of mistaken identity, or something of this nature. If they did know the person, of course, it could be a targeted attack.
However, if it turns out that the attack was not random, but that it was instead based on the victim's religion, race, gender or some other such factor, it can then be considered a hate crime.
It's often useful to consider discrimination in a more general sense when deciding if something is a hate crime or not. For example, you may know that employers cannot base their hiring on someone's race or religion. When this sort of discrimination against a group of people is involved in a crime, it becomes a hate crime.
As you can imagine, proving that something was a hate crime and not a random act can be difficult, and those who are accused must know their legal options in Pennsylvania.
Source: Federal Bureau of Investigation, "Hate Crimes—Overview," accessed April 08, 2016