The rover will use a device called MOXIE for the task, or in NASA speak Mars Oxygen In-Situ Resource Utilization Laboratory. The cube-shaped device is a fuel cell in reverse, as JPL systems engineer Jim Lewis explains in the video below.
The process – a very complicated one – goes like this: Martian atmosphere (which is 96 percent carbon dioxide) is captured and ran through a solid oxide electrolysis unit. Some chemical magic happens there– check the video for explanations – and oxygen comes out at the other end.
About the same process described in Andy Weir’s The Martian, where the habitation modules were capable of generating their own breathable atmosphere.
The amount of oxygen generated during the process will, of course, be tiny, but it will mark the beginning of official terraforming efforts. If it works, larger and larger fuel cell units will be sent to Mars, in the hope they will be able to sustain human colonies and rid us of the need to carry the oxygen with us to the neighboring planet.
The results of the experiment will be known pretty fast. The Mars 2020 mission will land in February 2021, and aside for trying to generate oxygen, it will mark the first time humans have actively search for signs of life on another planet.
For now, NASA has no official plans to grow potatoes on Mars.