When magnetic lines of flux encounter high permeability material, the magnetic forces are both absorbed by the material and redirected away from their target.
The most effective shields are constructed as enclosures such as boxes or cylinders with cap ends. The field follows the line of the enclosure so an enclosed shape keeps stray fields from finding gaps that could cause unintended interference.