A death in office is the death of a person who was incumbent of an office-position until the time of death. Such deaths have been usually due to natural causes, but they are also caused by accidents and murders.
The death of most popes and monarchs have been deaths in office, since they have usually held their papacy/reign for the rest of their lives.
Most office positions require that the person is constantly competent in performing the associated duties, and as such, deaths in office are usually premature deaths.
Sir John Maybin colonial governors of Northern Rhodesia (now Zambia) (1941)