How does an Animated Undead Determine Hostility, and how does it Defend Itself?

From the spell Animate Undead,

If you issue no commands, the creature only defends itself against hostile creatures.

There are two troubling terms here, for me. One is defends, and the other is hostile.

Defends is not to my knowledge a keyword. Does the undead only take the Dodge action against hostile creatures, or does it also attempt to eliminate the threat?

Hostile is a keyword, but I’m not positive it is being used as a keyword in this situation. The keyword states

A hostile creature opposes the adventurers and their goals but doesn’t necessarily attack them on sight.

Is this the definition the animated undead is using? Must the hostility be directed towards the undead itself? Must the hostility involve an attack for the undead to take action?

The implications: An undead frequently may not need to receive a command if it plays loosely with the definitions of defends and hostile.