Properly caulking the shower trim can prevent mold growth behind the shower surround and the trim plates. Caulking can also prevent leaks, particularly in an upstairs shower where any water between floors can leak through the ceiling of the first floor.
There are quite a few options when it comes to buying caulking. I prefer to use DAP brand adhesive sealant because it has good mold resistance and does not easily crack or peal. Regardless of what brand you select it needs to be approved for use in shower and tub applications.