How it works
The two texts are split into lines and compared using the same longest
common subsequence technique behind most diff tools: it finds the
longest run of lines that appears in the same order in both texts, then
marks everything else as removed from the original or added in the
changed version.
Reading the output
Unchanged lines are shown as-is, removed lines are marked -, and added
lines are marked +. A line that was simply edited appears as a removed
copy of the old version directly followed by an added copy of the new one.
Line-level, not character-level
This compares whole lines. Changing one word in a long line marks that entire line as removed and re-added, rather than highlighting just the word that changed.