A hostile work environment is created when an employee experiences workplace harassment or discrimination that is pervasive and severe enough to affect their ability to work.