The core is keeping one piece of state alive across frames: velocity. While the user drags, you estimate velocity from the last few frames' movement; the instant they release, you keep updating position by that velocity (position += velocity) every frame. Multiply velocity by a friction coefficient (0.9–0.97) each frame so it decays toward zero, and stop the loop once velocity drops below a small threshold (say 0.02).
A coefficient closer to 1 slides longer; closer to 0 stops sooner. Part of why iOS scrolling feels distinctly "slippery" is exactly this coefficient being tuned. If the motion hits a boundary, damping it back the other way instead of just stopping connects naturally into a rubber-band effect.
Unlike duration-based animation, you never decide "how long this takes" up front — only the physical quantities. Throw hard and it travels far; nudge gently and it barely moves. That proportionality between input strength and outcome is the whole point of an inertia model.
When to use
Use it for released drags — lists, carousels, map panning — where input strength should show up in the result. Click-triggered transitions don't need it; a click has no "how hard you threw it."