In more detail
A text diff compares two versions of text and lists exactly what was added, removed or left unchanged. It finds the longest common subsequence of lines and reports everything else as a change. A modified line shows as one removal plus one addition, so changing 1 of 3 lines gives 1 removed, 1 added and 2 unchanged. Version control tools such as Git are built on this idea. Diffs can work by line, by word or by character, and they are sensitive to invisible differences such as trailing spaces, tabs versus spaces and Windows versus Unix line endings.
Why it matters
Reviewing a diff is far faster and safer than rereading a whole document: it shows the exact change, so a stray edit or a pasted secret cannot hide in a long file. It is also how patches are shared and how merge conflicts are found. Be aware that an automatic diff can be noisy: re-wrapped paragraphs or reordered lines may look like total rewrites even when the meaning barely changed.
Example
Comparing red / green / blue with red / yellow / blue gives, in the common unified format:
--- a.txt
+++ b.txt
@@ -1,3 +1,3 @@
red
-green
+yellow
blue
Lines starting with - exist only in the old text, lines starting with + only in the new one, and lines starting with a space are unchanged. Try it with the text diff checker, or compare structured data with the JSON diff checker. For tidying input first, see sort lines and remove duplicate lines.