When Samara was kept in the attic, she said the noise the horses made bothered her, so she psychically attacked them, and made them all terrified of her to the point of running into the sea and killing themselves. The reason the horse on the ferry kills itself is that Samara left her imprint on Rachel.