What can an Animated Undead do to Defend Itself? [duplicate]

From the spell Animate Undead,

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

A zombie is as smart as a mastiff while a skeleton is as smart as an ape.

What are some actions the animated undead might take in order to defend itself? Does it ready an attack? Does it move towards the hostiles to engage? I suggest these actions because animals of similar intelligence might do the same.