exoticdoc2: If the monkeys had an infinite amount of time, just by randomly typing, they would hit every letter combination possible. One of those combinations would contain all of the works of Shakespeare. It’s not that they would know that they had written Shakespeare; it’s just a logical outcome of a random process.
By the way, I wrote an article on this subject for my Alternate Reality News Service a few years back. The Million Monkey Experiment resulted in most of a poem by Edgar Allen Poe, which confused the researchers no end!