It depends on the tool used for diff. Normally diffs compare lines. If one line is changed
on a revision and the same line is modified on another revision, if you try to merge them you'll have a conflict.
diff
is based on solving the longest common subsequence problem.
diff
does not know a line was modified. It knows a line (or various lines) was removed and
another one (or more than one) was inserted between two identical parts of file.
revision A:
a b c
d e f
g h i
revision B:
a b c
d e a f
g h i
$ diff A B
will output that line d e f
was removed
and line d e a f
was inserted on file B
in comparison with file A between the identical
lines a b c
and g h i
.
If file A is modified into C:
a b c
c
d e b f
g h i
the diff will output that the same line was removed,
but lines c
and d e b f
were inserted.
Merging B and C, the conflict will not be only
d e a f
====
d e b f
but
d e a f
====
c
d e b f
So, in a short way, diff searches for identical blocks of lines.
If files were modified between these blocks on both files (and the modification
was not identical), there will be a conflict.