once the value of any field was reset, in this case $1 was reset by same value, awk will re-organize the whole line with default OFS=" ".
also the $1=$1 here will filter the empty line (after the last ";") out.
the example below may explain more clearly:
kent$ cat t.txt
aaa
bbb;
ccc
ddd;
eee
fff;
print the line directly:
kent$ awk 'BEGIN{RS=";";ORS=";\n"}{print $0}' t.txt
aaa
bbb;
ccc
ddd;
eee
fff;
;
$1 was reset, output lines look good, but the empty line is still there
kent$ awk 'BEGIN{RS=";";ORS=";\n"}{$1=$1;print $0}' t.txt
aaa bbb;
ccc ddd;
eee fff;
;
ok, now the empty line was filtered out with if statement
kent$ awk 'BEGIN{RS=";";ORS=";\n"}{if($1=$1) print $0}' t.txt
aaa bbb;
ccc ddd;
eee fff;
so if write it in short:
kent$ awk 'BEGIN{RS=";";ORS=";\n"}$1=$1' t.txt
aaa bbb;
ccc ddd;
eee fff;