Hero of Ideals and Zekrom
Zekrom was commanded by the Hero of Ideals one thousand years prior to the events of the films. At the end of their war with the Hero of Truth and his Reshiram, it returned to the form of a Dragon Stone and was sealed away in the caves inside the Sword of the Vale.
During the actual events of the films, Zekrom helps Reshiram save the world from the corrupted Dragon Force by funneling it into the Sword of the Vale. It also aids by trying to destroy the Protecting Pillars and then by helping guide the Sword of the Vale back down to the ground.
In Black—Victini and Reshiram
Sometime during the three years he spent traveling the world prior to the events of the film, Damon happened to overhear Zekrom calling to him while he observed the ruined Kingdom of the Vale alongside Mannes. Together, the two of them went down into the caves inside the Sword of the Vale, where they became separated. At the bottom of the cave Damon discovered the Dragon Stone containing Zekrom and reawakened it.
Zekrom under Damon's control
With Zekrom's help, Damon traveled to the villages of the People of the Vale and managed to convince them to support him. Its first appearance in the film comes when it helps Damon destroy a giant iceberg that threatens to destroy Glacine's village in a polar region. It later appears in a flashback as Damon tells the story of his travels.
When he raises the Sword of the Vale and comes to be opposed by Ash, Cilan, Iris, Carlita and Juanita, Damon summons Zekrom to aid him. It battles Juanita's Golurk, which Zekrom easily defeats.
The second time it fights Golurk, it is interrupted by Reshiram, which Ash has discovered and allied with. The two dragons battle after Reshiram drops Ash at the castle, ending in Zekrom's defeat. Zekrom and Reshiram then realize that Damon's actions have unleashed a corrupted Dragon Force that threatens to destroy the world, and both dragons blows away the clouds to reveal this fact to Damon.
In White—Victini and Zekrom
Zekrom appears in the story of the People of the Vale, but does not appear itself until Ash discovers its Dragon Stone inside the Sword of the Vale. It questions Ash about what ideal he is pursuing, and when he answers that he wants to save Victini, Zekrom is satisfied in Ash's ideals and appears before him as an ally.
It bursts out of the cave and rescues Juanita's Golurk by stopping Damon's Reshiram's attack.