Magnetic memory operates based on the orientation of magnetic domains within a material. Each memory cell consists of a magnetic tunnel junction (MTJ), which includes two ferromagnetic layers separated by a thin insulating layer. Data is stored by changing the magnetization direction of one layer relative to the other. The resistance of the MTJ changes depending on whether the magnetizations are parallel or antiparallel, allowing for binary data representation.