if you are using 6v /12v/ or more volts motor then u can control this through your microcontroller .which gives only 5v and less current.
Advantages of relays: Relays can switch AC and DC, transistors can only switch DC. Relays can switch high voltages, transistors cannot. Relays are a better choice for switching large currents (> 5A). Relays can switch many contacts at once.