In X and Y, there is a Pokemon named Agislash. He has a signature ability called Stance Change. It has a description that says: "The Pokemon changes form depending on how it battles." What exactly does that mean? Does it swap Offensive Capabilities with Defensive?
Aegislash changes form dependant upon the moves it uses.
If Aegislash uses the move King's Shield, or enters the battle, it goes to Shield Forme. Shield Forme has higher defense and lower attack.
If Aegislash uses a damaging move, it goes to Blade Forme, swapping its base Attack with it's Defense, causing it to have a higher Attack and lower defense.
Aegislash's forms are the first set of forms to actually showcase the concept in Kalos. This Pokémon will change its form depending upon what moves it makes. The Formes are unique in that they completely swap their base stats with a focus on Attack in Blade Forme and Defence in Shield Forme If it makes any attacking moves, it switches to Blade Forme, whereas if uses the move King's Shield, it will be in its Shield Forme. Whenever it is sent out into battle, it is in its Shield Forme allowing for switching in without damage.
It's also note-worthy that moves that call other moves do not change Aegislash's form, even if they call a damaging move.
Stance Change allows Aegislash to switch between Shield Forme (high defensive stats, low offensive stats) and Blade Forme (high offensive stats, low defensive stats). Aegislash is always in Shield Forme if it is not battling, and as such, switching out reverts it to Shield Forme. It changes to Blade Forme when using a damaging move, and reverts to Shield Forme when using King's Shield. Status moves other than King's Shield will not change its form. Moves that call other moves, such as Sleep Talk, will not change Aegislash's Forme, even if they call a damaging move or King's Shield.
Stance Change is activated independently of sleep or confusion, and will therefore cause a change in stance even if Aegislash is affected by either status. It can also not be traced, copied with Role Play, suppressed with Gastro Acid, or replaced with Simple Beam, Worry Seed, Entrainment, or Skill Swap. Obtaining Stance Change through Imposter will not allow the other Pokemon to transform.
When Aegislash swaps he is in shield forme. When he uses a damaging move it switches to blade forme. He basically switches his defense and his attack stats.
King's Shield makes him revert back to shield forme.
Sword Dance, Iron Defense and the likes do not change his forme.
Also as an aside. DO NOT include sword dance in his moveset. Because when he switches forme it basically increases his defense instead. So use iron defense, when he switches forme it actually improves his attack.