Describing a scene from an animal's point of view
"What literary devices and techniques should be used in this kind of scene?"
I should say, the same devices that you might use to write from any character's point of view. Humans are familiar, we broadly know their biases in terms of vulnerabilities, desires, abilities and the sensorium they inhabit. That being said, ever tried writing from the point of view of someone completely in the dark, or a blind person? How about a deaf-blind person? An internally generated narrative from such a point of view is radically different from a sighted, hearing one, yes?
Pigs. Although their brains follow the same general plan as all mammals there are certain quantifiable differences. More of their brain is used for processing smells than that of humans - sure they may want freedom, food, a mate, social contact, shelter from harm - all the same stuff we want au fond, but the way they perceive the world is radically coloured by an acute awareness of the smell of fear, death, waste, food, sex etc.. Also how would a lack of hands change the way that you might deal with a gate? Your snout is sensitive and versatile, can you use it to push the latch? (Can you reach?) Or is posessing sharp teeth better for biting through the rope? How does the rope taste? Mouthfeel? What in a pig's experience could it compare it with? Snouts and trotters are built for digging under gates though. But first, ask yourself whether a pig would go through the gate; maybe it's been lead that way before by the farm-hand, maybe the farm-hand was cruel and his smell provokes fear, and is that direction most natural for a pig? What about darting for cover, maybe snuffling about in the ditch for a better way out? - ever vigilant for sounds of pursuit or something to eat.
Horses. If a horse stamps its front hooves at you you should take it as a warning. If one rakes the ground with its front hooves, it may be bored/frustrated and want to run free. There are many detailed examples of equine body language you can plunder here: https://thehorse.com/14965/translating-equine-body-language/ The odd little detail specific to your animal may help to lend realism.
Likewise other animals have their biases of sensory acuity and behavioural habits that you'll be able to figure out with a little thought and research.
For example, I give you "The Hole in the Zero" By M.K. Joseph. A character at one point becomes a plant - completley immobile and terrified at the destruction of all its siblings and Mother. The sound of the destructive machines is emphasized in this case, with the screaming of the dendrites as they're destroyed, and some description of the burning smell - this may not be a realistic reflection of the way plants react, but it works well for the scene, I'd suggest because it viscerally and emotionally appeals to the audience such that disbelief is suspended effortlessley.
Next example, same book - a character becomes an insect. The description of its entire sensorium becomes about tasting its surrroundings for traces of salts, food. As it suffers a death by fire, intriguingly, the last thing it tastes is its own juices. Throughout the scene the creature's narrative is tinged with longing and regret of loss for a past mating partner. This from an objective point of view is perhaps realistic regarding the insect's world-view through chemical signaling, but less so regarding its memory and cognition - yet again it works as a self contained scene perhaps because the audience is hooked by the regret scenario.
For ultimate anthropomorphism, Fluke by James Herbert. It's been a while since I read it, but it is written entirely from the point of view of a man who's been reincarnated as a dog and knows it. From what I remember, he's driven by very human urges and a desire to resolve conflicts from his previous life - worth a read.
I'd say it depends how deep you want to go, or to take your readers into the world of the animal. Getting the reader engaged in the scene requires the same things as getting them interested in a human character, unless your readership is not human of course.