A bishop may resign for a number of reasons. Canonically, bishops are required to turn in their letters of resignation when they turn 75. The Holy Father can either accept the letter or ask them to stay on a little longer until he finds a suitable successor.
Interestingly enough, Joseph Cardinal Ratzinger turned in his letter of resignation as Prefect for the Congregation of the Doctrine of the Faith when he turned 75 back in 2002. Pope John Paul II looked at it and promptly pitched it.
Another reason for resignation may be because a prelate, often an archbishop, is asked to serve the Church in one of the curias as prefect. This was the case with William Cardinal Leveda who resigned from his post as Archbishop to head the CDF, and Antonio Cardinal Canizares Llorea who also resigned as Archbishop of Toledo to head the Congregation for Divine Worship and the Discipline of the Sacraments. Archbishop Raymond Burke also resigned as Archbishop of St. Louis to become the Prefect of the Apostolic Signature (curial department that deals with Canon Law).