In the average workplace, one of the most crucial professional relationships an employee has is the one with whoever directly supervises them. More often than not, they are going to be the person who reports your performance to the higher-ups and dictates whether or not your experience in the workplace is a pleasant one. Unless they are putting you in an unacceptable position, it pays to play nice and keep the peace where possible.
Nonetheless, that doesn’t stop some people from testing the boundaries with those who manage them. Sometimes this stems from a place of jealousy; other times, it is just plain immature. Whatever the cause may be, these types rarely respond well to getting checked on their behavior. It is a challenge from a management perspective to handle it in the right way, especially if the manager in question has never dealt with a similar kind of situation before.