In more detail
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.