Most chimneys that are built on the exterior wall have galvanized straps that are embedded into the mortar joints and then nailed to the wall sheathing. Many times, especially when flashing fails, moisture gets between the brick and wall and will either deteriorate the nail or strap, sometimes both. Once that connection fails the sheer weight of the chimney will cause it to lean, even when supported by a footing.
Here is an example of what I see often with leaning chimneys. In this particular case the wall behind the chimney was not protected by a moisture barrier and unfortunately not only was the chimney leaning but the wall was rotted as well. The only solution was a complete chimney replacement and wall repair at a cost of 30K.