Animator Friz Freleng introduced Yosemite Sam in the 1945 film "Hare Trigger". With his irascible temper, short stature, and fiery hair, Sam was in some ways an alter-ego of Freleng, though the animator would later deny any intentional resemblance. Another influence was the Red Skelton character Sheriff Deadeye.
Freleng created Yosemite Sam to be a more worthy adversary for Bugs Bunny. Until then, Bugs' major foe had been Elmer Fudd, a man so mild-mannered and dim-witted that Freleng thought Bugs actually came off as a bully by duping him. Sam, on the other hand, was extremely violent and belligerant, not at all a pushover like Fudd. Freleng (inspired by the Tex Avery cartoon "Dangerous Dan McFoo") compacted into a tiny body and 11-gallon hat the largest voice (courtesy of Mel Blanc) and the largest ego this side of the Pecos.
For over 19 years, Freleng had almost exclusive usage of Sam at the Warner studio. Though officially a cowboy, Freleng put Sam in a different costume in almost every film: a knight, a Roman legionnaire, a pirate, a Confederate soldier. The humor of the cartoons inevitably springs from the odd miscasting of the hot-tempered cowboy.
Despite Freleng's intentions, Sam doesn't prove much brighter than Elmer in his encounters with Bugs. With all his bluff and bluster, Sam stands in contrast to Freleng's calmly cocky rabbit. However it is Sam's own cockiness that always gets the best of him; he is incapable of turning down a challenge. Every time Bugs dares Sam to "step across that line," Sam can't help but do so, even if he steps off into empty space or down a mine shaft.