An unsupervised machine learning algorithm called K-Means Clustering is used to find natural groupings of players. Imagine plotting every player in each postion on a graph based on stats relevant to their position; K-Means automatically identifies the "centers" of dense groups, with the objective being to minimise the distance between datapoints in that group and the centre using an iterative process. This reveals distinct styles of play (e.g., "Ball Playing Middle" vs. "Impact Middle") without human bias.
Since we can't plot all stats against eachother, we can use PCA (Principal Component Analysis) to simplify multiple stats into 3 key dimensions. For each position, 3 key qualities are chosen, with each quality being a PC1 representation of the stats that make up that quality: basically combining the stats into one. For example, we might combine "Try Assists", "Line Break Assists", and "Forced Drop Outs" into a single "Creativity" score. This allows us to visualize and compare players in a simple 3D space.