The pirates ran out of the cave and saw lots of torches. They thought the torches were the sheriff and his men. Huck and Jim had set up the torches.