Capacitor Basics: How do Capacitors Work?
As capacitors store energy, it is common practice to put a capacitor as close to a load (something that consumes power) so that if there is a voltage dip on the line, the capacitor can provide short bursts of current to resist that voltage dip.