In the context of the play, this phrase is spoken by the character Jaques, who is disillusioned with society and has chosen to live in the forest. Jaques finds solace and wisdom in the natural world and believes that nature can teach us important lessons about life and morality.
By comparing nature to sermons and books, Shakespeare is highlighting the idea that knowledge and understanding can be found in unexpected places and that one should be open to learning from all sources, including the natural environment.