He shoots it's leg off by accident and it falls over.
I assume if goes into battle with it's shields down which makes a lot of sense.
He also releases the balls by accident (knocking out many tanks and droids) and makes a hover tank veer and fire on other tanks before crashing by accident.
Seeing as Anakin destroys the droid command ship by accident too there seems to be a whole lot of happy accidents going on during that conflict, like having all the droids get their power and commands from a single source.
Presumably this is why ROTJ is the very last ever episode of the saga because George thinks Palpatine is the only thing the holding the Empire together too.