A family of Microsoft word processing software products for creating web, email, and print documents.
If you want to ensure a text comparison, you should put at least the first comparand inside quotation marks, e.g.
{ IF "{ MERGEFIELD FIELD1 }" = { MERGEFIELD FIELD2 } "SAME" "DIFFERENT" }
If you do not do that, there can actually be two problems
a. Word treats the fields as numeric (as in your table)
b. If the first comparand - { MERGEFIELD FIELD1 } - resolves to a text that is the name of a bookmark, the value of the bookmark will be compared with the value of the second comparand.
the one where the text in the field is the name of a bookmark, in which case the value of the bookmark may be used in the comparison.
So if you have, e.g.
{ SET abc "xxx" }
and { MERGEFIELD FIELD1 } is "abc" and { MERGEFIELD FIELD2 } is either "abc" or "xxx", the result of
{ IF { MERGEFIELD FIELD1 } = { MERGEFIELD FIELD2 } "SAME" "DIFFERENT" }
will be "SAME"
but in the case where { MERGEFIELD FIELD2 } is "xxx", the result of
{ IF "{ MERGEFIELD FIELD1 }" = { MERGEFIELD FIELD2 } "SAME" "DIFFERENT" }
will be "DIFFERENT".
Although I think that is strictly enough to avoid those problems, I prefer the clarity of quoting the other thing I expect to be treated as a string as well:
{ IF "{ MERGEFIELD FIELD1 }" = "{ MERGEFIELD FIELD2 }" "SAME" "DIFFERENT" }