In the 1870s the Malay Peninsula consisted of lots of states that were always in dispute with one another.
When the sultan of Perak died, their was a struggle for the throne. A British resident was installed to bring stability to the situation until a new sultan was found.
The British resident got carried away with his responsibilities and was murdered. A military force was sent in to restore order to the warring factions.