The song you are referring to is called "Beasts of England" it was taught to the animals by Old Major in Chapter 1 of the book.
"I will sing you that song now, comrades. I am old and my voice is hoarse, but when I have taught you the tune, you can sing it better for yourselves. It is called 'Beasts of England'." (Orwell)
When Old Major speaks to the animals, he inspires them with his vision that he saw in a dream, then he tells them that they must never falter in their belief in the cause or equality for all animals. He gives them a song to sing to inspire and support the rebellion.
"Old Major’s dream is of a world without man. He teaches them the revolutionary song Beasts of England."