How to decide in which direction the bone deforms the mesh?

I have this rigged mesh. The thigh is deformed as I expected:

enter image description here

Just for experiment, I paint some weight of thigh bone on waist:

enter image description here

But why does it deform like this? The thigh bone moves forwards, while the painted waist moves backwards.

enter image description here

I know I shouldn’t paint weight like this. This is purely for studying how bone animation works.

Because the thigh bone is rotated and you’re telling that part of the mesh to react to that rotation.

Try this: rotate the thigh bone back and forth from where you have it to the rest position. I suspect you’ll get a better understanding of what’s going on.

Just out of curiosity, what were you expecting would happen?