Basically the formula can help soldiers fight during winter so whoever has it has an advantage over the other side.
BTW the Chinese version if anyone is interested:
宋人有善为不龟手之药者,世世以洴澼絖为事。客闻之,请买其方百金。聚族而谋曰:『我世世为洴澼絖,不过数金;今一朝而鬻技百金,请与之。』客得之,以说吴王。越有难,吴王使之将,冬与越人水战,大败越人,裂地而封之。
Also to answer the other question why a traveller may have the skills to lead an army. So first I think this is just a story because I can't anything recorded in history regarding this battle. Secondly, many "travellers" during that time were strategists who were either of aristocratic origin or very rich. They made their livelihood to persuade kings to follow their advices and make profit (in money, fame and land) from it. Some of them probably were rich enough to own small armies so technically they could lead armies for kings.
But again this is probably a story Zhuangzi made up to "prove" his point.