For example:
"X is a bad person, therefore their argument is invalid" is an ad-hominem. Bad people can still make valid arguments.
"X's argument is both invalid and in bad faith, therefore they are a bad person" is a logical inference.
It is the difference between "If you believe X then your school must have had brain-dead teachers" and "If you believe X you are brain-dead"