How Do They "Restore" Damaged/Dented/Bent Trim Anyway?

For example, chrome/stainless wheel well molding is always taking a beating, as well as other exterior chrome and metal adornments (see photos #1 & #2). I read where these things are "restored" somehow and somewhere. Is it performed by elves with tiny hammers? I can't picture straightening out the bent/dinged up metal pieces without making things worse. Maybe a lack imagination or a degree in metallurgy on my part but is there a video somewhere showing the secrets of this sort of alchemy? If I can't do it at home, at least show me how it's done! Thank you.

P.S When I remove the exterior moldings after having been placed 50 or so years prior, I find all kinds of dirt/gunk stuck under the moldings (see photo #3 of molding on '65 Barracuda quarter panel). When restoring, are these moldings just screwed or pushed back on or is there a filler/gasket/silicone used in the gap? Thanks again.

wheel molding bent 1.JPG

wheel molding bent 2.JPG

DSC04339.jpg