The second part of you query has a straightforward formula provided you are using Office 2013 (I think) or later
= TEXTJOIN( ",", 1, NamesWithBlanks )
where the parameters are "," to specify the separator, 1 or TRUE to omit blanks and the name of your range or array.
The first part of the query is reasonable direct using Office 365 but a mess on older versions.
= COUNTIFS( TableNames, TableNames )
will return the number of times each name occurs in the list ( I have used a Named formula 'occurrences' for this to simplify subsequent formulas ).
The next step is to sort the list in descending order of occurrences
= SORTBY( TableNames, occurrences,-1 ) )
The next step is to filter the sorted list (as a nested formula)
= UNIQUE( SORTBY( TableNames, occurrences,-1 ) )
In this case I defined the formula to be 'distinctNames', giving the final formula
= TEXTJOIN( ", ", 1, distinctNames )
If you do not like or understand named formulas, each name may be substituted by its formula, giving a single multiply-nested result.
If you do not have access to dynamic arrays, it is still possible with legacy Excel but Power Query would be far more straightforward.