The discolouration of the silver portion of the mirror occurs over time. Our suction shower mirror had the same issue.
Mirrors are created with silver nitrate which gives it the reflective property. The silver nitrate is protected with copper sulfate and paint to prevent damage.
Eventually, the paint goes off and the chemicals lead to the formation of black edges. Moisture, mirror cleaning products, air could also be reasons for the mirror rot.
You can avoid such black edging with the help of a frame. Adding a frame to the mirror can prevent mirror rotting as this happens only at the edges.
You can also re-silver the mirror to make the mirror look new. The silver kit is available on the market. Clean the edges with distilled water and apply the silver coating over the edges. Again, apply a second coat over the first one and paint it with any mirror repair paint.