Why does rotating an object on its axes in a different order result in a different final rotation?
If you go to the top middle of your screen you will see its literally called local. Change that to global and you should be rotating on the global x and y axis and z axis.
In the second gif the objects origin is at the corner of it (were the 3d cursor is) Fix this by selecting the object and right clicking then setting the origin to the geometry and it should be fixed.