This is essentially a cliché of Japanese swordsmanship, often repeated by people without any extensive experience of either Zen or swordsmanship. Historically, most Japanese swordsmen were not particularly familiar with Zen Buddhism, but would be expected to have some understanding of Mikkyo or “esoteric” Buddhism. Mikkyo contains a number of magic charms and spells to overcome fear or survive dangerous situations, so warriors were interested in using Mikkyo for what they believed to be practical purposes. Zen enlightenment was, to put it mildly, above their pay grade.
The connection between Zen and swordsmanship came about because a handful of extremely talented swordsmen personally saw a connection between the Zen mindset and the mindset needed to survive a sword combat. These swordsmen- including members of the famous Yagyu family, Miyamoto Musashi and Yamaoka Tesshu- wrote about swordsmanship using terms and analogies drawn from Zen. Some of them, including the founder of the Mugai Ryu tradition, actually used the phrase “ken zen ichi nyo.” Because of the influence of these famous swordsmen, the concept became extremely popular late in the nineteenth century before devolving into a cliché.
The irony is that like many clichés , it's actually true if fully understood. It's only a distortion if understood superficially. To gain more insight into “ken zen ichi nyo,” a good place to start is in the writings of Takuan. Takuan was a famous Zen master who used analogies drawn from swordsmanship- a reversal of the process I've described here.