Have you ever taken a look at the size of a chimney? Chimneys are often large outsets that are set away from the exterior walls of the home. The reason being is that chimneys need to be a minimum of 4" of solid masonry to be constructed correctly. This design not only requires additional space, but it also adds a lot of additional weight.
The weight of the chimney will then have to be transferred onto a typically larger footing to support it. Think of the chimney and the footing as a big concrete rectangle. This rectangle is also going to be top heavy just because of it's required height to stretch beyond the roof line of the home. This weight added with poorly compacted soils will start to cause the chimney to rotate away from the home. The reason that it rotates away is that there is typically minimal strapping towards the top of the chimney and it is easier for the chimney to rotate away from the home than into it where it has additional support from the framing of the home.
When you look at your chimney the easiest way to tell if it is moving is to look up towards the top of the chimney by the roof line. You will notice a larger gap at the top as the top will pull away at a quicker rate than the lower portion.
The best way to fix a leaning chimney is to put piers on 3 sides of the chimney. 1 on each side and 1 in the rear. The piers on the side of the chimney will help to keep the chimney from leaning from side to side and keep it level. The pier in the back of the chimney is there to lift that portion of the footing and rotate the chimney back into place towards the framing of the home. This method of repair is highly effective at correcting a leaning chimney.