How and why was Pakistan created?

In 1930, Muhammad Iqbal called for an autonomous Muslim state in "northwestern India for Indian Muslims". The Muslim League, a political party, rose to popularity in the late 1930s. Muhammad Ali Jinnah espoused the Two Nation Theory and led the Muslim League to adopt the Lahore Resolution of 1940, demanding the formation of independent states for Muslims in the East and the West of British India. Eventually, a united Pakistan with two wings - West Pakistan and East Pakistan - gained independence from the British, on August 14, 1947.
Modern-day Pakistan came in existence in 1971, after a civil war in the distant East Pakistan and emergence of an independent Bangladesh.