Why a chip needs one
Digital ICs draw current in sharp spikes when they switch. The power supply sits centimeters away behind inductive traces and planes, so it is too slow to respond. The local capacitor holds charge at the pins and delivers it in nanoseconds. The supply then refills the capacitor at its own pace. Without the capacitor, the rail (the supply voltage line) at the pins sags on every switching edge. That brings noise, timing violations, and brown-out resets (the chip restarting because the voltage dipped).
Practice: values and placement
The standard recipe is 100nF (nanofarads) ceramic, X7R or better (a common ceramic grade), per power pin, as close to the IC as possible. Add bulk capacitance (10µF and up) per rail region for slower changes. Effectiveness is limited by the inductance of the connection, so shrink the loop. Put the capacitor on the same side as the IC, give each pad its own via (a small hole that connects layers) straight to the planes, and do not share vias between capacitors. Watch DC bias derating: a 6.3V-rated ceramic on a 3.3V rail may deliver only about 60% of its nominal capacitance.
How MICA places decoupling
From the netlist, so none are forgotten
MICA adds a small set of decoupling capacitors from its curated parts when it builds the design. It does not yet guarantee one for every power pin on every chip, so check this in the schematic (the map of which parts connect to which). ERC (electrical rule check, a test that the wiring makes sense) flags power pins that are not connected. The decoupling tutorial has the full treatment. It covers anti-resonance, where two capacitor values interact and raise impedance (how much a signal is slowed or reflected) at some frequencies.
2-layer and 4-layer boards: what changes
On a 4-layer board with planes, decoupling is simple: the capacitor sits next to the IC, vias go straight down to the planes, and the loop stays small. On a 2-layer board there is no plane to via to. Route the capacitor's ground pad to the ground pour with the shortest, widest trace you can, and keep the power feed from capacitor to IC pin short. The loop area will be larger whatever you do. Compensate with slightly more bulk capacitance. Keep the loops of noisy ICs away from sensitive analog sections (the parts that handle continuous signals). This is one of the quiet reasons 4-layer boards are easier: the planes do half the decoupling work for you.