This is a niche little trick in awk, that forces you to re-build $0 with the updated modifiers (in this case RS and OFS)
Remember that, the crux of the manipulation is done by setting of RS= and OFS=, which in plain words means, reset the default input record separator from newline to empty and set the output field separator to ,, thereby converting the newlines to commas in the input.
But how would you let awk interpret it? Because there is no pattern { action } part applicable here. If you just use 1 as below implying a default true action for all lines, it doesn't work.
awk 1 RS= OFS=, file
It doesn't do anything because the fields RS, OFS apply when the input line is "modified" in someway. It could be even a dumb statement like rewrite $1 i.e. { $1 = $1 }1 overwrite first column with itself. Understand what really happens under the hood is, as part of modifying $1 i.e. the current line, you get to apply the values of RS and OFS which in case produce your desired effect.
The one you had shown is also something similar. NF is the number of columns in a line split by the default field separator. So you intentionally modify it to itself NF=NF, i.e. suggesting a rebuild, but the rebuilt line is basically the same, but with the updated modified values of RS, OFS or any configuration.
So any of the following are functionally, the same
awk NF=NF RS= OFS=,
awk '{ $1 = $1 }1' RS= OFS=,