Animals most definitely understand the idea of being set free, but it is not the same way we perceive and define freedom to be. "Freedom" is a relative idea/concept. We all have different ideas of freedom, animals are no different. Even if our definition is more complex than theirs, that does not mean that they cannot comprehend the idea of being free.
It is stretching it to think that animals understand the intellectual concept of freedom, but they are capable of feeling that their natural, maybe I should say their instinctual, desire for freedom of movement is being constrained. It seems a contradiction to me to think that it is not realized by animals that they are lacking something in their lives that is essential to their well being.
They obviously do not understand the definition of freedom the way people do. Any animal that you put in a cage knows that is not how there life was meant to be lived. They say dolphins try to commit suicide when they get trapped for to long. While, that is supposedly just a theory and controversial. I can see that happening with how smart dolphins are. Animals are not meant to live in cages.
By the knowledge of body language everyone has a sense of zone. An animal would have a periphery of say 5 meters. If you encroach that space they might feel uncomfortable. If you make a cage that is say 2x2 meters (smaller that his private zone) the animal is bound to feel uncomfortable. But if the cage is bigger than this that's it. Even if they are caged they won't realize it. A lion would require a cage of 25 sq. Km. We humans are caged in to our own houses and countries but the boundaries are so massive that we don't realize it. But the minute we want to step out in to someone else's house (or country) we'll be stopped. So, let alone the freedom of animal we ourselves do not understand freedom in it's true sense. I don't think an animal would understand this.
Animals simply aren't intelligent enough to understand a concept like freedom or a concept of any other kind as a matter of fact. It is true that humans are animals, but people are of a higher order. No animal wants to be cage, but I think this is reflexive and instinctual. Perhaps some higher mammals can understand freedom in the most rudimentary sense.
Animals don't understand freedom, but they may understand more than humans by living entirely through the processes of their biological programming without the potential for self-harm, emotionally or physically, that comes in the form of self-consciousness and conscience. Animals are not capable of understanding freedom, but behaving the way they know they are trained to behave without question may indeed make them even more free than we could ever be.
I do not think that animals are capable of understanding freedom. Animals do not possess the ability to comprehend something like freedom. I think that only humans can truly understand what the meaning of the word freedom is all about. That doesn't mean we shouldn't continue to fight for animal rights though.