I'm currently on project #9(Motorized Pinwheel) of the Arduino Starter Kit's Projects book which involves the use of a DC(spinning) motor in conjunction with an Arduino, and the book im using states that motors typically require more current that what the Arduino can provide, and that the Arduino can only provide 40mA, which is much less than what most motors require to do work.
However, the book states
Transistors are components that allow you to control high current and high voltage power sources from the low current output of the Arduino
Motors require special consideration when being controlled by a microcontroller.Typically the microcontroller cannot provide enough current and/or voltage to power a motor.Because of this, you use transistors to interface between the two.
I've done some googling and know the basics of how transistors works (e,g doping, n-type and p-type) but i don't see why attaching a transistor to a circuit/microcontroller that outputs less current that the motor requires magically makes the motor works.
I would really appreciate any clarification and/or explanations.