There is a lot of history, nuance, and complexity to the issue, but, one of the primary reasons Pakistan was created was because of religion. The sprawling land mass that was colonial India under British rule was partitioned into three distinct places. Each one of these was created because the majority of its inhabitants worshiped one of two religions, Hinduism and Islam. This happened in 1947.
The independence movement in India began in earnest in the last half of the 19th century. It then gained strength in the early part of the 20th century, as nationalism swept Asia and Africa as it had Europe a century before. Crusaders such as Mohandas Gandhi began campaigning for independence from Britain. The independence campaign gained international focus, thanks in large part to the actions of Gandhi and a few other brave people, and the pressure was finally too much for Britain to ignore.
India, however, was not just one country full of like-minded people when it came to worship. Two fundamentally different religions dominated the soulful landscape of the world's second most populous country. The conflict between followers of those two faiths transcended the partition from Colonial India into India and Pakistan. Hinduism, one of the world's oldest religions, had millions of adherents living in India. Islam did as well, though its history was much shorter.
The British partitioned Colonial India according to population concerns. India was then and continues to be populated mostly by Hindus. Pakistan, on the other hand, had and continues to have a mostly Muslim population. However, neither of these are homogeneous, and the partition separated many people from their families.
Much like the building of the Berlin Wall did, the partitioning of India created as many problems as it solved. India was a mostly Hindu country, yes, but it had a sizable Muslim minority. The same was true, in reverse, for Pakistan, which was actually two landscapes to begin with. In 1947, Pakistan was actually West and East Pakistan, with India squarely in the middle. India divided both countries without a way to connect the two. East Pakistan became Bangladesh in 1971.
The sudden division of the colony into two separate countries led to mass exodus. Muslims went to Pakistan and Hindus to India. Some estimates put the "population exchange" at more than 14 million. The exoduses led to mass chaos and hysteria, often accompanied by violence. In many cases, faith-based massacres occurred behind country lines.
Another huge point of sometimes violent debate between India and Pakistan has been the area between the two countries that is claimed by both countries. Part of this area, known as Kashmir, has been the site of a number of conflicts, and is one of the most militarized areas of territorial dispute, with areas controlled by Pakistan, India, and China. Conflicts over this region and on other serious issues have led to an escalating arms race between India and Pakistan, with both sides claiming to have nuclear weapons.