In Tolkien's The Hobbit or There and Back Again, the wizard Gandalf introduces dwarves two at a time to Beorn to ensure their safety. Beorn is not too fond of company, and the dwarves need a safe place to hide and rest and recuperate before moving on.
Beorn is a shape-shifter, a skin-changer. He has a great love for animals and a bigger dislike for goblins. He is somewhat of a loner and detests lots of company, so Gandalf and Bilbo walk in and engage him in the story of their adventure while introducing two dwarves at a time at regular intervals, thereby interrupting the story regularly and keeping Beorn interested in it. By the end of it, Beorn likes it so much that he offers everyone dinner, protection and provisions for further journeying.
Had it not been for Gandalf's trickery, the dwarves would never have gotten the safety of Beorn's house, would most likely have been attached by goblins at night, never gotten provisions and Beorn's useful advice. So, by tricking Beorn into inviting two dwarves at a time, Gandalf ensured the safety of the party and the continuance of their journey.