Answer
Some people who purchase stocks only purchase those stocks on a whim, at a moment's notice. These purchases on whims are part of the animal spirits Keynes suggested. Keynes' animal spirits were also known as irrational bursts of optimism and pessimism. Optimism and pessimism can be partially caused by psychological factors.
Work Step by Step
However, the efficient markets hypothesis is the theory that prices for assets account for all publicly available information about the asset's value. The hypothesis says nothing about irrational bursts of optimism or pessimism.