The problem is the electronics world is more complicated than this is a 12V adapter and it can provide 5A of current. These values are rating for a constant current. It does not tell you how fast the power supply can adapt to current changes.
So, while the power supply might be able to drive a motor with 4A it may not be able to provide 100mA for a 1µs pulse. Capacitors can be used to provide short bursts of current to a digital circuit while the power supply will then only charge the capacitor at a slower rate.
This is true not only for power supplies but every element in your circuit. A wire is not just a resistor it has an inductive element that depends on length and frequency as well.
Check the datasheet of components you are using for recommended circuits and PCB layouts. When it is critical the datasheet will often tell you to place the component as close as possible to certain pins.