The Sikh Kingdom rose to prominence under Ranjit Singh and it was not until after his death that the British were able to annex Sikh territories.
The origins of the Sikh Kingdom can be traced back to the Mughal period (as early as 1707), however it was formally established under Maharaja Ranjit Singh when he began to unify the independent misls (sovereign states) after capturing Lahore (around 1799).
Ranjit Singh is considered the greatest of Sikh kings and his army was considered a formidable force. He made substantial efforts to modernize his army using the latest training and weapons. He systematically extended the frontiers of Punjab and brought the regions around Amritsar, Lahore, Multan, Kashmir and Peshawar under his rule. In 1809 Ranjit Singh signed the Amritsar Treaty with the British, agreeing to maintain the Sutlej as his eastern border. This treaty heralded the Western expansion of the Sikh Kingdom into Pashtun territory and peaceful relations with the British.
After Ranjit Singh’s death in 1839 the Sikh Kingdom fell into disorder and a succession of rulers was rapidly overthrown. The British East India Company used the weakening of the Kingdom as an opportunity to wage war and annex Sikh territory.
The first Anglo-Sikh War was waged between 1845 – 46, comprising of the Battle of Ferozshah and Battle of Sobraon. The British won several preliminary victories, decisively defeating the Sikhs at Aliwal and Sobraon and occupying Lahore on February 20, 1846. By the Treaty of Lahore signed in March 1846, Sikhs were forced to cede the valuable regions of Jammu, Kashmir, Hazara, Jalandhar Doab (between the Rivers Beas and Sutlej) and several other areas, reducing their territory to a fraction of its size. In addition controls were placed on the size of the army.
The second Anglo-Sikh War was fought between 1848 – 49. Resentment towards British rule led to an uprising in Multan in 1848. This was followed by a series of outbreaks. The Governor General, Lord Dalhousie, declared war, and within months the Sikhs were forced to surrender due to the reduced size of their army. All of the Sikh territory was annexed to the British crown on 29 March 1849.
BBC Radio: This Sceptred Isle (A 90 part history of the British Empire) –Episode 48: The First Sikh War