I assume you mean "How did the stranger outwit 'Smiley' " in the Mark Twain story since there was no Stanley.
Jim Smiley loved to bet on anything--chickens, dogs and tomcats included--and he discovered a talented frog that he named Dan'l Webster. Dan'l could jump higher than any frog Smiley had ever seen, and he was willing to put money on his frog's skills. One day, a stranger came to town. After examining Dan'l, he told Smiley that he saw nothing special about the frog and that he would bet against him--if he had a frog of his own. Smiley took the bet, leaving Dan'l with the stranger while he went to the swamp to find another frog. The wily stranger opened Dan'l's mouth and poured in a teaspoon full of "quail shot" (or bird shot, the pellets found in a shotgun shell), and waited for Smiley to return. When the contest began, the stranger's new frog leaped off, but Dan'l "couldn't budge." The weight of the pellets prevented him from moving. Smiley was outwitted by a man more clever than he.
In this story, Jim Smiley is outwitted when he makes a bet with a stranger and loses. Remember that Jim Smiley is well-known in Cavaleras County as a man who loves to make bets on pretty much anything, including the jumping abilities of his recently trained frog, Dan'l Webster.
One day, he meets a stranger who bets him $40 that his frog cannot jump any higher than any average frog. Being a gambler, Smiley immediately agrees to the bet. The stranger does not have a frog, so Smiley goes off to the swamp to procure another and, while he is gone, the stranger feeds Dan'l Webster some "quail shot" to make him heavier and, therefore, unable to jump high.
The stranger's ploy works: Dan'l Webster cannot jump at all and Smiley loses the bet. It is only after the stranger has left town that Smiley realizes what has happened. Despite his efforts, Smiley never catches up with the stranger and so never recoups his losses.