STT-RAM operates by controlling the orientation of magnetic moments in a magnetic tunnel junction (MTJ). An MTJ typically consists of two ferromagnetic layers separated by a thin insulating layer. The magnetic orientation of one layer is fixed, while the other can be switched between parallel and antiparallel states. The spin-transfer torque effect is used to change the state of the free layer, thereby writing data. The resistance of the MTJ changes depending on the relative orientation of the magnetic layers, which can be read as binary data.