Good question. There's several factors.
Some motors like the Ezee and BPM in the Emotion Neo are physically bigger and designed for more power.
Next factor is the current that the controller allows. The more amps, the better they climb, but small motors can get too hot if you push too much current through them. Most bikes with small motors are set to about 14 amps, but the motors can be run at 20 amps if you don't laboour them at low revs, which gives a significant improvement to climbing ability. Many controllers can be modified to give higher current.
A controller set at higher current can be a problem if your battery can't provide it. Often the controller is set to what the battery can give, so higher amps is only an option if you have a big or strong battery. Conversely, if your battery is too weak for what the controller is set to, the voltage sags and you get less power.
Next factor is speed of the motor. A low speed winding on the motor will allow higher efficiency when climbing slowly, but a higher speed version of the same motor will produce more power than the low speed version when in a small wheel.