Most projects start with a size and payload for the robot. This drives axis torque requirements, speed requirements, and size requirements. The biggest question is whether a gear will be needed.
Direct drive works for certain robots that have relatively light loading. Direct drive is also very attractive for collaborative robots, because any gearing has implications in reflected inertia limiting stopping time. After the decision on gearing, a decision whether to integrate a frameless motor kit or buy a housed servo motor is next. Housed motors are easier to use but tend to be long and thin versus short and wide.
Almost all robots big and small have moved to highly integrated frameless motors that share the main bearing systems, eliminate couplings and offer shorter axial packaging. Lastly, based on the payload, bearings will need to be selected to handle the loading, speeds and any through hole that a robot joint might require. Lastly, the robot joint output needs a high resolution accurate encoder, AND the input side needs an encoder with medium resolution to run the motor.  High resolution is 20+ bits and medium is about 16 bits, absolute encoders are always preferred for less wires, and the best information. They are not much more expensive than incremental encoders these days.  You basically pay for accuracy, high resolution and an absolute interface is standard.