The premise of this assertion has always been totally ridiculous to me. If monkeys were typing randomly, no amount of time would ever produce the works of Shakespeare.
Before any work of Shakespeare was complete, there would be several copies of Animal Farm, because it is much shorter. But that wouldn’t happen either because the world would run out of paper and ink long before any intelligible books were written.
And if you added infinite paper, ink, monkeys, food, typewriters, and the space needed to generate Shakespeare randomly, the errant texts would fill our galaxy. The monkeys would be drowning in them.
And, even though, an infinite amount of time would never produce Shakespeare because of factors like those above, if it were to happen, it would take a sentient being an exponentially longer time to sort through the volumes to find that one that was complete and correct. (Reading with comprehension takes significantly more time than random typing.)
The sentient beings would also need to coincidentally speak Early Modern English. And they would need to continue to understand it during the entirety of the billions of years quest needed to locate the works of Shakespeare. In fact, they would need an original of the works of Shakespeare because, otherwise, they would be unable to distinguish between a version of Romeo and Juliette where they take poison and die, as opposed to another version where they fly off in the sunset in a space ship.
And even then, Shakespeare would not tell the sentient beings how the monkeys, typewriters, paper, and ink came to exist in the first place.
Those who assert this monkey business simply prefer an unimposing deity of Infinite Time, rather than a living deity who makes demands of created beings. But nothing about infinite time insures any kind of life or progress. The more time goes by, the more likelihood there is of an extinction level event. Even on a rare planet that can support life, the extreme likelihood exists of such events happening more frequently than any supposed evolutionary process that could foster complex life. And that is one of many reasons, billions of years is not a satisfactory answer to the origin of life.