The Mars 2020 rover, like Curiosity, has an electric motor in all six wheels. The drive system is highly automated, meaning the operators give commands like “move at this speed to this position 2 meters that way, then take pictures of that rock”. This is necessary to avoid issues with light-time delay, which is between 4 and 24 minutes both ways.
Along with a rocker-bogie passive suspension and an automated high-detail proximity terrain scanning system, the rover has an advanced traction control system that drives each wheel independently.
The following is an educated guess: The terrain scan provides an environment for a rover dynamics simulation to run, then the data from the sim is compared to the real-time sensor data on the rover as it is executing a (slow) maneuver. If there is significant discrepancy, the rover stops and waits for human intervention.