difference subtracts the two layers' channel values (and takes the absolute value) to combine them. Placed over white (255,255,255), the result is 255 minus the background — an exact colour inversion. Worth remembering: over black, 255 − 0 = 255, so a white shape stays plain white and nothing visibly changes there.
That's exactly why it's popular for a cursor or focus ring that needs to stay visible no matter what colour is underneath. Leave the circle in the demo alone and it drifts on its own; move your pointer over it and it follows — watch the colours invert wherever it passes.
A blend mixes with everything painted beneath it inside the same stacking context — not just the background you intended. To scope it to a specific background, wrap both in a separate context with isolation: isolate so no other layer sneaks in underneath. Like filter and transform, mix-blend-mode also forces its own paint layer.
When to use
For custom cursors or a selection highlight that needs to read regardless of background colour. Always scope the blend with isolation: isolate.