Sexual harassment falls under two basic premises. One is “quid pro quo” sexual harrassment and the other is creating a hostile working environment.
The first is fairly easy to recognize because quid pro quo is “something for something.” You give me sex, I won’t fire you. You give me sex I will give you a raise.
It’s an offer and that is easily seen. Proving it may be harder but it’s not terribly ambiguous. It follows up with a “no means no” doctrine, which is the first time someone does it, it’s not necessarily quid pro quo, though it could be, if you decline it (no means no) then it becomes quid pro quo.
Creating a hostile working environment falls under the “umbrella” of sexual harassment but does not need to involve sex at all.
You have to understand a hostile working environment is not the same as an unpleasant one. Lots of people are miserable jerks and they they are only happy when they make someone else more miserable. Being a jerk is not illegal.
A hostile working environment is one that makes it virtually impossible for a “reasonable” person to perform their work duties. Who decides what’s reasonable? The H/R department, the company, and finally, if need be, the court system.
In the OP case it’s impossible to know for sure, if said actions constituted an environment that made it impossible for the others to do their job to a “reasonable” standard.
In the OP hypothetical, again giving gifts to certain employees and not others is perfectly acceptable provided you aren’t discriminating against a protected class.
Everyone belongs to at least three protected classes, Sex, Race and Religion (atheism falls under this). Sexual Orientation is probably also included (The EEOC has said it was but it’s not been thoroughly tested in courts yet). Also people over 40 are a protected class, those under 40 are not. In addition states and local governments (county and city) may have more protected classes, for example Michigan is the only state that puts weight into a protected class.
So a person can be let go for sexual harassment even though it has nothing to do with sex, because hostile working environment falls under the umbrella.