C. Lloyd Morgan, answered from the texts and cited to the page.
Much of what passes for animal reasoning is the slow work of trial and error: the animal tries, fails, tries again, and the movement that chances to succeed is fixed by the satisfaction it brings, until the useful action is retained and the useless dropped. Intelligence, in its beginnings, is built up from below by this sifting of chance variations in behaviour, as the fit forms of the body are built up by the sifting of chance variations in the stock.1234
If the circumstances be so modified as to render the particular mode of meeting them ineffectual, after trying again and again in the old way, he will sometimes stumble upon the proper mode of overcoming the difficulty, and after doing so two or three times a new conscious situation involving the requisite associations will be established, and the appropriate behaviour will become habitual.Animal Behaviour, p. 139
But what are the range and limits of animal intelligence, and whether it attains the level of rational conduct, in the restricted sense of the term "yational," are questions open to discussion, to which answers are more likely to be obtained through experiment than by chance observations.Animal Behaviour, p. 138
Directly he had seized it, others gave chase, and one took it from him and swallowed it. Next day I threw in among them a hive-bee and an eristalis. Both were left untouched. I drew their attention now to one, and now to the other, by tapping near, and moving it with my pencil but without effect.An Introduction to Comparative Psychology, pp. 206–207
Subsequently the caterpillar was occasionally pecked at, and more frequently merely looked at; but soon it was left unnoticed. Fresh small worms, on the other hand, were at once and with confidence snapped up and carried off, causing a most exciting chase, the fortunate possessor being allowed no peace for the delightful efforts necessary for swallowing the worm.An Introduction to Comparative Psychology, pp. 215–216
That trial-and-error is a real and widespread mode of learning I hold, and I described it before it was given a law; that it is the WHOLE of learning I did not claim, and Köhler's apes, if they truly restructure the field at a stroke, show a mode my chicks and terriers did not display. The evolutionary analogy — learning as selection among behaviours — I hold as more than a metaphor.