To understand where numbers come from we must first discuss Numerosity and Cardinality. These are two different ways of viewing groups of objects that are not necessarily connected, but both are important for our understanding of how humans relate to numbers.
Numerosity can be seen in most, if not all, animals. Simply put numerosity is the ability to look at groups and know which is largely without counting. This is not a precise system and performs best with 1:3/ 1:4 ratios but is precise enough for a clear pattern of attention given to differing amounts when presented together or in sequence in participants who cannot count. This can e seen in infants with gaze length showing a consistent change when they are presented with a new group with a different amount than the previous group (Primitive Concepts of Number and the Developing Human Brain, 2019 Kersey and Cantion). This will show up prior to the ability to count or speak and shows the ancient origins of numerosity as other primates show the same ability. Numerosity is also responsible for the ability to estimate how many items are available without counting.
It is important to note that numerosity is not inferior or a less evolved version of counting. While both deal with the amount of objects in a group numerosity should not be considered a counting or proto-counting system. Given the limited number systems we have to study and the ability to teach cardinality not only to humans but other animals it must be considered a separate system.
Cardinality is the ability to add plus one to a sequence and add it to a group of numbers. This is the basis for all counting systems no matter the outward form. This does not require language as one-to-one representation can be made before words for numbers exist via material artifacts (fingers, tokens, notches, strung beads). Counting in this manner is thought to predate number words as notches on bone, fingers, or strung beads can communicate a concept of numbers purely by visual and tactile means. A series of notches can indicate days of travel, a knotted string a set amount of distance, and strung beads even today act in a rosary as a form of counting without having to count (Bootstrapping Ordinal Thinking, 2017 Overmann et all).
Obtaining cardinality does not come all at once. Children often learn counting songs before they are able to count with intention - rote learning of cardinality without conceptual attachment to number word concepts. There is also a lag time in understand with months-long gaps between understanding one, two, three, and four. After those numbers are mastered a child can be considered a Cardinality Principle-knower and will be able to rapidly understand numbers beyond four. This mirrors the universal number system of one, two, three (sometimes), four (rarely) and then "many" that we see in counting systems and suggests a deeply rooted link.
Ordinality is an important part of cardinality. Ordinality is a number indicating the position of something in a series or order. For English this can be as simple as "three" being the ordinal position of the cardinal number "three" or "march" being the ordinal position of third month of the year. Being able to place things in seqeuntial order is vital to being able to create or use a calendar as well as providing a route to decontextualize numbers from specific groups to apply to broad categories.