How it works
The pipeline starts with filtering: declarations from applicable style sheets, true conditions, matching selectors, and valid syntax become declared values. The cascade sorts them; the first is the cascaded value. Defaulting turns that into the specified value: if there's nothing, inherited properties take the parent's computed value and others their initial value; inherit, initial, unset, revert and revert-layer are resolved here.
The computed value follows the property definition's "Computed value" line. The spec's guidance is to resolve as much as possible without layout, network requests, or values from anything but the element and its parent. Relative lengths are absolutised, relative URLs become absolute, keywords such as bolder are replaced, and some percentages are multiplied out (for font-size, by the parent's font size). A computed value exists even when the property doesn't apply, which is what lets text-transform set on a <p> reach the text inside it.
The used value completes the calculation with layout: auto widths, percentages of the containing block, flex and grid sizes. The actual value reflects device limits.
Walking one declaration through the pipeline, #a { width: calc(50% + 1em) } in a 400px, 20px-font box:
/* declared: calc(50% + 1em) (plus any losing declarations)
cascaded: calc(50% + 1em)
specified: calc(50% + 1em)
computed: calc(50% + 20px) em is absolute; % needs layout
used: 220px
resolved: 220px width is a "used value" special case */
Edge cases
Border widths snap at computed time. Backgrounds and Borders Level 3 defines border-width's computed value as "absolute length, snapped as a border width": below one device pixel rounds up to 1, above it rounds down to a whole device pixel. At a device pixel ratio of 1, both browsers returned 1px for 0.5px, 2px for 2.7px and 4px for 4.2px. The cascade spec's own example table, which shows 4.2px until the actual value, predates that rule.
Positioned offsets. position: relative; bottom: 10px read back top as -10px (the used value) in both browsers. On a static element, top: 10px read back 10px: it doesn't apply, so the computed value is returned. On an absolutely positioned element, left: auto read back as 0px, its used static position.
Colours are always used values. currentcolor in border-color reads back as the colour it stands for, e.g. rgb(1, 2, 3). red, #f00 and hsl(0 100% 50%) all read back as rgb(255, 0, 0).
Serialisation, not data. Computed values are abstract; getComputedStyle serialises them. transform: rotate(45deg) read back as matrix(0.707107, 0.707107, -0.707107, 0.707107, 0, 0) and a relative url(img.png) as an absolute file: URL in both browsers.
Real-world scenario
A tooltip script reads getComputedStyle(trigger).width to position itself. It works until the trigger is an inline <a>: width doesn't apply, so it gets the computed value, auto in both browsers, and parseFloat gives NaN. The fix is to measure the box with getBoundingClientRect(), which always reports layout, and to use getComputedStyle only for style information, such as reading line-height or checking display.
A related bug: a theme toggle reads getComputedStyle(el).color and compares it to "red". Resolved colours serialise as rgb(255, 0, 0), so the comparison never matches. Compare serialised forms, or read a custom property you control.
Reading a used value like width requires up-to-date layout, so interleaving style writes and getComputedStyle reads in a loop forces the browser to lay out the page repeatedly; batch reads before writes.
Trade-offs
Separating computed from used values is what makes inheritance cheap and predictable: children inherit a value that doesn't depend on their own layout, and layout runs once afterwards. The cost is that the value developers see in getComputedStyle is a compatibility compromise, used for some properties and computed for others. For typed values there's computedStyleMap() (CSS Typed OM), shipped in Chrome 66 and Safari 16.4 but not yet in Firefox.