This answer is late because I completely missed your comment. Sorry about that! This topic is very large and can take a lot to understand all of it, so I will keep my answer as simple as I can to address the question.
There are two terms I will use in this answer and it is important to understand the differences: rotation and orientation. Orientation is the transform of the bone at any given point. A rotation is the action or difference of changing the orientation of a bone.
Euler rotation math is a common cause of problems in animation, primarily because the underlying functionality of Euler angles is hidden from the user. This is something you're discovering for yourself. Euler angles are compound calculations. Each axis is calculated in sequence based on a particular order. In XYZ order, X is calculated first, Y second, Z third. Because of this ordering, axis rotations can counter each other. You don't need to know the particulars of gimbal lock, but when you get further into animation it is good to research. Euler rotations are advantageous when a bone needs to rotate on one axis continually or for long stretches of time.
Quaternion math is a solution to this problem. When using quaternions, rotations are always interpolated as the shortest path between two orientations. This makes it easier for the animator to work in the 3D view without worrying about underlying functionality. There are no axes fighting each other in the math.
If you are working in the 3D view, don't need the graph editor, and your bone is not rotating continually in one axis, your safest bet is to use quaternion mode for your rotations. If you rely heavily on the graph editor and you understand the idea of compound rotations, use Euler in one form or another.
For further education, I highly recommend Nathan Vegdahl's Humane Rigging training DVD on Youtube. The video in the link is the start of his explanation of rotation modes.