This is an aikido technique that has its roots in jujutsu. Aikido comes from a synthisis of many different styles of jutsu, both armed and unarmed. As a result, you will find some form of weapons training and familiarization in most aikido dojo.
Just like any instance of combat with an armed opponent, these sword techniques would never be easy to execute on the battlefield. The samurai were still taught these skills to give them a small chance of success should they lose their weapon, or some other factor were to present itself to allow them that fighting chance.
In reality, however, the chances for success in a situation like this would have been very slim, but not altogether impossible.
Still, in aikido, we practice, train, and study these movements on both sides. That is to say we study the movements of the attacker (uke, teki, uchidachi) and the movements of the defender (nage, ware, shidachi).
This is one of the areas where Sun Tzu’s advice in Art of War really comes into play. Know youself and you will win 50% of your battles. Know your enemy and you will win 50% of your battles. Know yourself and your enemy and you will win 100% of the time.
In todays modern age of technology it makes it very hard to remain unseen on the battlefield for very long. So one can stay hidden, but for how long is a real concern among troops wishing to remain unseen.
Before the invention of radars blind soldiers were used to listen for approaching aircraft that were still out of sight.
Aside from satellite, various detection devices and cameras, the methods used to locate an unseen enemy come in small stages of getting to know your enemy. You start to learn certain habits and patterns and then find ways to exploit those.
Skills like tracking, intelligence gathering, laying traps and ambushes all become part of an overall strategy to locate and flush out the enemy. Takes a little time, in some cases a lot of time and patience, especially if the enemy is good at remaining unseen while still engaging on the battlefield, but these are some of the methods put into practice.