How text diff works
A diff compares two versions of text and shows exactly what changed between them. This tool works line by line: it matches up the lines that stayed the same and flags every line that was added in the new version or deleted from the old one.
Under the hood it uses a longest-common-subsequence (LCS) algorithm to find the longest set of lines both versions share in order, then walks both texts once to emit an ordered list of equal, added, and deleted lines. This is the same approach used by source-control tools to show changes between two files.
Use the options to ignore differences in whitespace (so re-indented lines count as unchanged) or letter case (so capitalisation changes don't count as edits). The result reports the number of added and deleted lines plus a line-by-line change list you can scan at a glance.