FastStone is not color-managed, it is only color-space aware - i.e. whilst it can interpret the RGB data and ICC profile in the file correctly it does not have or use a color-management module to write those values to the display via the profile.
As for specifically how it FastStone counts colours / implements an algorithm... you can find a full list of features on their site here, but I wasn't able to find a specific answer to your question.
Thank you for the response. I had read that as well but it doesn't really answer the question.
The reason I ask is more curiosity than anything else but I'm struck by how color counts differ using different products on images. They seem to somewhat correlate with image file size which is often associated with image quality and with amount of resources and speed/time expended in getting the results. I have also searched the FastStone documentation but not surprisingly the feature is only as a feature with no explanation of how it is done.