"When the cow grazes, it often consumes and swallows what is called tramp iron: baling and barbed wire, staples, nails, and other metallic objects. These objects are indigestible and would lodge in the reticulum and cause inflammation resulting in lower milk production (for dairy cattle) or lower weight gain (for feeder stock). This condition is called hardware disease.
The cow magnet attracts such objects and prevents them from becoming lodged in the animal's tissue. While the resultant mass of iron remains in the cow's rumen as a pseudobezoar (an intentionally introduced bezoar), it does not cause the severe problems of hardware disease. Cow magnets cannot be passed through a cow's 4th bonivial meta-colon." (Wikipedia)