The instrument on Perseverance that produces oxygen is MOXIE, short for the Mars Oxygen In-Situ Resource Utilization Experiment.
MOXIE is a technology demonstration rather than one of Perseverance’s primary geology instruments. It draws in Mars’s atmosphere, which is about 96% carbon dioxide, heats the gas, and separates oxygen atoms from the carbon and oxygen molecules using solid-oxide electrolysis. The oxygen is then measured and released.
NASA reported MOXIE’s first successful oxygen production in April 2021. Over its operating life, the toaster-sized experiment demonstrated that oxygen could be made repeatedly in the Martian environment. At peak performance, it produced about 12 grams of oxygen per hour at 98% purity or better.
MOXIE’s purpose was to test a capability future astronauts could need. Locally produced oxygen could support breathing, but producing large quantities for rocket propellant would be even more valuable because hauling oxidizer from Earth would be extremely expensive. RAD, SAM, and REMS are instruments associated with other Mars missions or different scientific functions.