Don't format the data on the right as a table.
Enter the following formula in D5:
=UNIQUE(Table1[Key])
where Table1 is the name of the table on the left. The formula will automatically spill to the cell(s) below.
In E5, enter the formula
=TEXTJOIN(", ",TRUE,IF(Table1[Key]=D5,Table1[Data],""))
and fill or copy down.