Robots can be programmed on-line using a teach pendant or off-line using PC software. In the latter case the program is then transferred to the robot controller.
On-line programming is faster and easier, but there could be instances that off-line programming is preferable. For instance if the robot cannot be taken out of production for programming or if it the installation and commissioning time is very short. In this case programming can be done in advance.