It uses a trick that in a multiplication expression, (../my:field1 = "false") will be treated as the value 1 when my:field1 is false, and 0 otherwise. This is then multiplied by 5000, so it boils down to this:
field1 is not false:
substring("Field 1 is checked ", 0)
field1 is false:
substring("Field 1 is checked ", 5000)
In the first case, the substring function returns the value of the string from character 0 (the beginning) through the end, resulting in the whole string.
In the second case, the result is the substring of the string starting from character 5000 through the end. Since the string is not 5000 characters long, the result is an empty string.