B12 is a stored vitamin. You can take high doses on a less regular basis and doctors do prescribe injections of vitamin B12 for patients with severe deficiency. Most vegans aren’t severely deficient, they’re at a high risk of deficiency without dietary supplements. Bioavailability and absorption are the main reasons for this recommendation. It’s better to take lower doses often as you won’t absorb as much of a higher dose (which is why these are injections).
As for the anthropology, it is more complex than that. Early hominins may have been on a largely plant-based diet but they weren’t strictly vegan, they were scavengers and hunters. They ate basically anything necessary to survive. It is difficult to generalise about early human diets due to the diversity between populations, even with more accurate genomic data recently. Plants were often their main source of carbohydrates and proteins but a small amount of other foods if enough for micronutrients. They occasionally also ate fish and eggs. They’re also known to have eaten bone marrow (tools have been found to extract it) of animals killed other predators even before hunting. These are also sources rich in vitamin B12. As mentioned by others, the source of B12 in animals is the bacteria that they eat. They were also exposed to more bacteria than we are now living in clean sanitised environments including our food and drinking water.
It’s also inaccurate to claim that early hominins were still “healthy”, despite being on a largely plant-based diet. By modern standards, they were not. Life expectancy is a poor indicator here since infant mortality and disease were high, so those surviving into adulthood still lived over the average life expectancy. They still did not live nearly as long as we do today. We cannot cite a plant-based diet as the only cause of this. There are many other differences to our environment and lifestyle. This was a time when an infection could fester and be life threatening. A broken bone or losing your teeth could be a death sentence. We simply cannot compare our health to this time period. These were by no means the best conditions to be healthy. Your doctors recommendations are based on medical and biochemical studies on what is best for your health and well-being, not how your ancestors managed to survive despite suffering many now preventable illnesses.
Improvements in nutrition have been shown to have caused our average height to increase meaningfully, even in the last few centuries. A better understanding of our needs for vitamins is a contributing factor for this (such as the reduction in scurvy and rickets). A deficiency in vitamins in childhood is much more of a concern than adulthood as it can affect your growth and development irreversibly. This continues to occur in the developing world and certainly did in early hominins. There are known time periods of population bottlenecks and low genetic diversity that are evidence that human populations came close to extinction several times (a few 100,000 years ago). Starvation in harsh conditions has been suggested to have caused this (and the may have lead to the migrations that followed).