I read this in a siddur at a Sephardic Shul yesterday. The women around me agreed wholeheartedly with the statement, stating that it's Halacha.
I don't see the connection, other than the idea that there is a holiness to rejoicing in Shabbat, the more you eat the happier you are, therefore you are holier if you partake, and more worthy of protection. I'm not sure I care for my own personal beliefs, but I am curious how eating a meal was joined with protection from a war.
The story of Gog and Magog is in Yechezkhel 37-38.