Gaimon is a former pirate who ended up literally becoming a treasure chest—and not by choice. While scaling a cliff on the Island of Rare Animals during a treasure hunt with his crew, he lost his grip and got wedged inside an empty chest. His crew left him behind, and the thing wouldn't come off. He was stuck like that for 20 years, able to move his hands, head, and feet, but otherwise a living, breathing piece of furniture.
After getting trapped, Gaimon shrank enough that he could no longer climb out of the cliff. Instead, he became the island's self-appointed guardian, using his gun and a creepy voice to scare away anyone who got too close to his "treasure." It was a solid defense strategy—until Luffy and the Straw Hat crew showed up. They actually passed his trials and won him over as a friend.
The real kicker came when Luffy reached the top of the cliff and discovered the truth: all those chests Gaimon had been protecting for two decades were completely empty. The irony hit hard. Luffy offered him a spot on the crew, but Gaimon turned it down. Instead, he made peace with his situation and decided the animals living on the island were his real treasure, committing himself to their protection going forward.
In the "Special Cover Miniseries," Chibi Buggy eventually shows up and the two become friends.
Content compiled by AnimeList.moe from publicly available sources.