When reading a story, I often see sentences like this
"The ogre smiled, showing his rotten teeth"
I think the original sentence should be "The ogre smiled and showed his rotten teeth" or "The ogre smiled while showing his rotten teeth"which is reduced into "The ogre smiled, showing his rotten teeth".
I also notice they often use this kind of structure with verbs with direct speech.
For example, "He said 'I don't know', scratching his head"