Impact drivers are usually smaller (using 1/4" hex drive) for driving in smaller screws. Impact wrenches are larger and deliver more power, and are usually 3/8" square drive and larger. Impact wrenches are usually for loosening and fastening large nuts and bolts.
They both operate in a similar manner- they use rotational hammering action to twist the fastener. Compared to a traditional drill or ratchet that applies continuous force, impact drivers and wrenches are able to exert much more force by "pulsing" the force in a twisting fashion, in several short, but powerful blows. This results in less reactionary torque (tool trying to pull out of your hands), less stripped screwheads and much higher power- useful for driving long, or stuck screws/bolts.