The duel started just shortly after the rebels arrival on Cymoon I, following which Luke Skywalker broke off from the rest of the group and ended up running into Darth Vader while making his way through an Imperial weapons factory.
Upon encountering Vader, Luke ignighted his lightsaber, despite being warned to run by the force ghost of Obi-Wan Kenobi, Luke's old Jedi mentor, and began to duel Vader. Despite his attempts to strike down Vader, Luke was quickly overpowered by the Sith Lord, who recognized him as the rebel who destroyed the Death Star during the Battle of Yavin. After overpowering the boy, Vader took his lightsaber and was about to strike him down when he realized that the lightsaber Luke was using was his very own lightsaber from when he was a Jedi Knight named Anakin Skywalker.
However, before Vader could fully comprehend this, or even try to finish Luke off, the duel was stopped by Han Solo, Leia Organa, and R2-D2, who had stolen an All Terrain Armored Transport with the aid of a few freed Imperial slaves, and used it to briefly distract Vader long enough for Luke to escape, later sparking a massive battle.