All sorts of behavior can create what employees deem to be a "hostile work environment". But, in the legal sense, a hostile work environment is caused by unwelcome conduct in the workplace, in the form of discriminatory harassment toward one or more employees based on inclusion in a protected class.
The harasser might be an employee, such as a Supervisor or a coworker, or even a non-employee, i.e. a Contractor. But who the workplace harasser is doesn't matter as much in the legal sense, as does the fact that he or she is creating an intimidating, offensive, abusive, or hostile work environment through discriminatory workplace harassment.