As someone completely new to pedals, can someone clarify this for me?

What does an overdrive-type pedal do that an amp won't/can't on its own? If you have a high gain input, or a gain control knob, or if you have amp modeling for crunchy amp styles, what do you gain with the pedal?