Hare_Geist has it pretty much right apart from the beginning
It was not emerged from any war of such. Guru Nanak Dev Ji being nonormal child would always have his mind on remembering God. He would look around at the people of the other religions and find so much hypocracy and how things have changed. He never found the full truth in any religion....partly due to the fact that most people stopped following their religion properly and started adding things. He dissapeared into water for 3 day and evryone thought he was dead. When he came out of water the first thing he said was
Ek Onkar There is only One God
Sat Naam Truth is his name
Karta Purkh He is the creator
Nir Bhau He is without fear
Nir Vair He is without hate
Akaal Moorat He is immortal, without form
Ajooni He is beyond birth and death
Saibhang He is self-illuminated
Gur Parsaad He is realised by the kindness of the true Guru.
http://www.sikhiwiki.org/index.php?title=Mool_Mantra
He was born into a Hindu family but blatently refused Hinduism as he found so many useless rituals in it, so much hypocracy, so much division and inequality.