CountsBy
CountsBy[{e1,e2,…},f] gives an association whose keys are the distinct values of the f[ei], and whose values give the number of times these f[ei] values appear.
CountsBy[f] represents an operator form of CountsBy that can be applied to an expression.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.