Mela Maghi, held at the holy city of Sri Muktsar Sahib each year in January, or the month of Magh according to Nanakshahi calendar is one of the most important melas (fairs) of India and the most important of all religiously significant gatherings of the Sikhs.
Guru Amar Das Ji chose Maghi as one of the three festivals to be celebrated by Sikhs (the others being Baisakhi and Diwali) 
After the battle of Muktsar which took place on 30 Poh (30 29 December 1705) and the cremation taking place the next day on the day of Maghi,5 Maghi became to be associated with the forty Sikhs and the battle of Muktsar.
The Maghi fair is held to honour the memory of the forty Sikh warriors killed during the Battle of Muktsar in 1705. Muktsar, originally called Khidrana, was named as Muktsar (“the pool of liberation”) following the battle. These forty Sikhs, led by their leader Mahan Singh, had formally deserted Sri Guru Gobind Singh in the need of hour, and signed a written memorandum to the effect. When Mai Bhago, a valiant and upright lady, heard of this cowardly act, she scolded the Singh’s and inspired them refresh with spirit of bravery for which Sikhs are known. Hence the unit went back and joined the Guru who was already engaged in action at Khidrana. All forty of them attained martyrdom. The memorandum (bedawa) was torn-down by the Guru himself just before Mahan Singh died.