Sikhism is a comparative recent religion and traces its foundation to the first Sikh Guru Called Nanak. He lived between the period 1469-1539. Guru Nanak is often referred to as Baba Nanak and also as Nanak Pir. The history of the period reveals that Nanak made 4 long voyages/travels including a pilgrimage to Mecca.
Guru Nanak composed many hymns which are now part of Hindi literature. The language of his compositions was Braj Bhasa, a dialect of Hindi. In all his verses and hymns Nanak castigated the Hindu Pandit. He also composed verses against the Muslim Mullah. However though he criticized the Vedas, he never said a word against the Koran. In fact the robe or choga worn by him had salutations to the great Muhammad and one god imprinted all over it.He also preached extensively against Sati and child marriage, as well as Hindu rituals on death.
Nanak was a reformer and many Muslims like Hazrat Mirza Ghulam Ahmed, who founded the Ahmeddiya Faith consider that he had converted to Islam, but this is far from truth. One can say that he did accept certain Islamic tenets but he did not convert to Islam
In all his preaching's and verses, there is no mention of cow slaughter. He has not written anything for or against cow slaughter. However after the passing away of Nanak things began to change from about the time of the 4th Guru Hargovind. This is the period when Hindu practices crept back into Sikhism and it began to distance itself from Islam. By about the 9th Guru TegBahadur the break with Islam was complete. History tells us that all the Hindus approached Guru Teg Bahadur and requested him to put a stop to slaughter of cows as well as their persecution. He agreed to appeal to Aurangzeb.
The Moghul emperor Aurangzeb, the greatest of all Mughals thought that in case he could convert Teg Bahadur to Islam, conversion of all Hindus to Islam would be a success. He imprisoned him in the Red Fort and offered to spare his life in case he converted to Islam. Teg Bahadur refused and was beheaded outside the Red Fort , which is marked by the Gurudwara Sis Ganj.
The 10th Guru Gobind Singh now took up the battle against the Moghuls. He introduced practices like Jhatka(killing of animals with one blow) for meat. This was directly opposite to Islamic theory of allowing an animal to bleed slowly to death (halal). However as the Guru had embraced many tenets of Hinduism, it became taboo to eat beef and killing a cow became a sacrilegious act.
In 1762, Ahmed Shah Abdali the Afghan Warrior after decimating the Mahrattas at the 3rd battle of Panipat (1761) proceeded to Amritsar and sacked the Golden temple. He filled the holy sarovar( pond) with carcasses of dead cows. This was an affront to all Sikhs and Baba Deep Singh led a Sikh army to save the Golden Temple. In the ensuing battle the Muslims were defeated and Baba Deep Singh could cleanse the temple of the dead cows. During this time the Sikh and Hindu beliefs on cow slaughter synchronized together.
Un 1798, the Sikh empire was established and Maharajah Ranjit Singh seized power. He reintroduced more of Hindu customs and also a caste division became aparant among Sikhs and exists to this day. The scheduled caste Sikhs are known as Mazhabi Sikhs. He also banned cow slaughter and as per reports this ban on cow slaaughter was enforced with force. There are reports of manyMuslims being beheaded during the reign of Maharajah Ranjit Singh for killing cows. One cannot understand how this belief got incorporated in Sikhism as the founder of Sikhism Nanak had said nothing about it, though he preached against sati and other ills of Hinduism.
Ranjit also ravaged the Badshahi Mosque ( famously built by Jahangir) at Lahore and converted it into a stable for his horses. In effect Sikh rule though tolerant of Muslims, gave the Hindus and Sikhs something to cheer about. He also built a massive army that under his General Hari SingH Nalwa bested the Afghans and seized the entire West Punjab and NW Frontier up to the Khyber Pass. Sadly when Ranjit Singh expired , Hindu customs had become so entrenched in Sikhism that 5 of his queens committed sati along with him.
The Sikhs were defeated by the English under General Lord Hugh Gough and the Punjab was annexed. The Bdshahi mosque was restored and cow slaughter was permitted as the English were fond of beef.
Thus one can see that killing of cows is now sacred in Sikhism and like Hindus, Sikhs will not eat cows meat. Sikhs will also only consume meat that involves killing an animal by severing its neck by one blow called Jhatka. The great guru Gobind felt this was a more humane way to kill an animal. One can say that Hindu practices have crept into Sikhism and the old pristine Sikhism as advocated by Nanak is not in existence. The 10th guru Gobind in fact made it the sword arm of the Hindus by his famous baptism at Anandpur Sahib in 1699, when he created the Khalsa. One can conclude that presently as things stand the Hindus and Sikhs have a similar belief as far as cow slaughter is concerned.