It has some metal in it that is supposed to help clamp it on the lip. The metal can fail causing the trim piece to start falling off.
I agree it may help slow the rusting process though.
I would get some Goop (brand name), remove the trim, wash the wheel well and fender lip, let dry, apply the Goop (it's basically a glue) to the edge of the fender and then shove the trim piece back on.
You may want to tape/clamp the trim in place while the Goop dries.