In the desired output file first and second columns are from file1, the third column shows what is going to be added for repeated ids, the fourth column is the values obtained by addition. The ids repeated will merge to one id as row 1 and 3 from File1 merged to row1 in File2.
The col#2 differs from the requirement?
(Also the b[] stores the $1 string twice, once as the index and another time as part of its value.)
The col#2 seems redundant anyway, so it is omitted in the following solution:
awk '
{
if ($1 in sum) {
sum[$1]+=$2; str[$1]=(str[$1] "+" $2)
} else {
sum[$1]=str[$1]=$2
}
}
END {
for (i in sum) printf "%s\t%s\t%s\n", i, str, sum
}
' infile
Because of the explicit if , adding the col#2 is simple - left as an exercise.
If you can live without the output field that indicates the detailed arithmetic, then this fairly simple command to sort, categorize, and sum associated values may be useful:
datamash --sort --group=1 sum 2
Here is a complete demonstastion script with output: