Gyroscopes are very interesting tools, able to ‘defy gravity’ and seemingly remove the laws of gravity. When they’re not spinning, they act normally, but when they are, an incredible feat of balancing takes place:
The reason why this happens is because of angular momentum; When something spins, it is spinning in one direction (left or right, horizontally). This direction is always perpendicular to the axis it is spinning from – here’s a diagram to help you:
The reason the gyroscope is amazing at balancing is that when the speed of rotation reaches a certain point, it starts to exert a horizontal force, like gravity. Since the spinning disk will always be perpendicular to the axis, it will always stay upright is spinning!
To keep ships stable, these are implemented in them, to keep them upright in waves or winds. The gyroscope is usually spun by a motor. The gyroscope is attache to the vessel, so the gyro’s natural tendency to stay upright also affects the ship.