The categorical distribution is like a bowl of colored balls. Let us say we know know the bowl statistics, meaning that we know how many balls there are of each color, let us say red, green, and blue. Then we pick a ball at random. Given the statistics, we can calculate the probability that the ball we picked is red. This probability is modeled by a categorical probability distribution of the ball colors.
See more at npmjs.com/package/categorical-distribution