I'd like to build a robotic arm...

I would like to know why a transistor may or should be used. Is it to work as a switch for the larger power circuit of the servos?