this is regex, in regex () is a capture group. these groups can be referenced in the replace second argument with $1 for the first group, $2 for the second and so on
for the regex, . matches anything, and {5} is a counter that make so that . is matched 5 time
end result is that the regex matches 5 characters in the capture group, those 5 characters are then referenced by $1 and a space is added after it by the replacement string
To add to what ILM explained, since there is a global flag (g) at the end of the regular expression, all groups of 5 characters will be matched so a value of “12345678901234” will become “12345 67890 1234”.