As other fallacies, Ad hominem fallacy implies a faulty reasoning or argument. in the case of Ad Hominem, this occurs because the speaker attacks his/her opponent traits, and does not provide any evidence to refute the opponent's argument.
This fallacy occurs in "Gracie is the worst class president ever. she doesn't even know how to dance" because the speaker does not explain why Gracie is not a good president, instead the speaker attacks Gracie by pointing out she does not know how to dance, which is not related to the Gracie being a bad president.