How did Perseverance make oxygen on Mars?

MOXIE converts carbon dioxide from the atmosphere with electrochemistry.

an orange box is suspended from a hanging platfrm. A hand with a glove touches it.
Technicians at NASA's Jet Propulsion Laboratory lower the Mars Oxygen In-Situ Resource Utilization Experiment (MOXIE) instrument into the belly of the Perseverance rover. Credits: NASA/JPL-Caltech