Phasing is the ability to walk through walls. The property is possessed by xorns, earth elementals, ghosts and shades. This does not allow one to cross pools of water, or walk through certain areas that are designated as non-phasing, e.g. all of Sokoban and a dividing wall in Moloch's Sanctum. SLASH'EM introduces the Spellbook of passwall, casting the corresponding spell will temporarily grant phasing.
The use of polymorphing into a phasing monster to gain a combat advantage is dubious, as neither the xorn nor the earth elemental are particularly tough, and cannot wear body armor or cloaks (in fact the earth elemental cannot wear anything). Phasing may be used as an alternative to digging, or to access items embedded in walls or to retreat if you're getting surrounded.
Strategically, phasing can be used to quickly bypass some areas of some maps. It is one way a Rogue character can solve their final quest puzzle. Some players will polymorph into a phasing creature for Gehennom mapping in order to make the search pattern simpler.