Short Answer / TL:DR
Gear ratios change the limits of the motor’s output - the maximum speed and the maximum torque.
Coding for rpm changes just changes the speed of the motor, given that it is within bounds of the current gear ratio’s maximum speed.
We use both all the time - I for example use gear ratios to lower the maximum output speed of 600 rpm motors to 450 rpm and increase the maximum torque for fun things like acceleration and pushing robots, and in the code I change the rpm of the motors based on joystick position.
Long Answer
How motors work
While not completely necessary, it’s nice to understand how a motor works to understand basic concepts such as this.

Image Source
VEX
Yay Evan I used citations are you proud of me :))
When a motor changes speed, it’s just changing how fast those electromagnets switch between negative, positive, and neutral.
A motor’s torque is determined by the strength of the magnets - how much electrical currrent flows through them.
By coding for a change in rpm, you’re telling the motor how fast to flip the polarity of those electromagnets. The maximum torque doesn’t change, as the maximum current/power it can pull stays the same.
What do gear ratios do?
I like class one levers. Class one levers are funny. They also help you understand gear ratios.
Let’s say the motor is that big finger trying to push down on the seesaw, and there is a big weight on the other end.
Changing the speed of the motor in the code is equivalent to this hand just pushing down faster - on the other end the load moves faster, but the hand’s max effort* it can use to lift the weight stays the same. The motor spins faster, but the torque limit stays the same.
However, changing where the hand is on the seesaw is equivalent to using a gear ratio - going further out reduces the speed at which the load on the other end moves, but the finger can exert less effort* to do so or it can lift more (gearing for low speed high torque). Going further in increases the speed at which the load on the other end moves, but the finger needs to exert much more effort* to do so (gearing for high speed low torque)
*I am dumb and do not know a better word to use instead of “effort”
Why do I need gear ratios then?
Well, motors have their limits.
A motor’s speed is limited by various things (how fast it can flip the electromagnet’s polarity, brushings, materials, etc.). A motor’s torque is limited by how much power it can pull.
You can set a motor to spin slower than it’s maximum - like setting a 480 rpm drivetrain to spin 360 rpm, but you won’t get more torque. And obviously you can’t set a motor to spin faster than what it currently can. And sometimes you need more torque for some nice acceleration or to push opponents around, but your motors can’t deliver enough power to do that.
A gear ratio helps by either increasing the output speed to be faster than what it currently can spin, or helps transfer some sacraficed speed for a lower speed drivetrain into extra torque that you can bully your opponents with or give you faster acceleration.
And now I go back to doomscrolling



