This concept commonly occurs in two main ways. It can be presented as a scripted event or it might manifest dynamically during the boss fight. Often this concept is used to show the boss' force or to illustrate their contempt for living beings.
Often this occurs during a cutscene before the boss fight. This technique is sometimes used for comedic effect - i.e. the player is introduced to a feeble-looking character, who is presented as the boss; following this, the real boss appears, who is far more imposing, and kills off the first character.
This occurs when bosses indiscriminately attack anyone in their vicinity (friend or foe). For example, a boss might shoot a weapon that is aimed at the player, but an enemy might get in the way and get killed instead.