The story as the tradition tells it: Jahangir, having imprisoned Guru Hargobind at Gwalior, agreed to free him. The Guru refused to leave while fifty-two princes remained held. The emperor conceded that as many could go as could hold onto the Guru's cloak as he walked out. The Guru had a cloak made with fifty-two tassels, and every prisoner left with him.
The episode is central to Sikh memory and is what the festival's name means: the day of the release of prisoners.
What can be said about it historically is narrower. The imprisonment at Gwalior is not in doubt, and neither is a release; Jahangir's own memoirs and later Sikh chronicles both place the Guru there. The number fifty-two, the condition, and the tassels come from later Sikh sources rather than contemporary record, and their earliest attestation postdates the events by a considerable margin. Some accounts also place the release a few days before Diwali rather than on it, with the observance settling onto Diwali afterwards.
Reporting this is not a challenge to the observance. The tassels carry the meaning the day exists to carry, that liberation is not taken alone, and that meaning is not contingent on whether a garment was made to specification in 1619.