For us humans it is a process of establishing a one-to-one relationship between objects and a long-since-memorized sequence of words that requires just one member of the sequence to be remembered in order to represent the number of objects.
https://neurosciencenews.com/neuron-counting-9898/
This article goes into it and mentions "numerical distance effect", which looks appropriate but not what I remember.
I did learn that people who play first person shooters can usually recognize more objects at once instantly; 6 or 7 instead of a more typical 4 or 5, if I recall correctly.
They used number of grapes in a hand to measure.