Keeping it simple , the purpose of the screen is to keep noise out of the wiring it surrounds or to stop that wiring creating noise elsewhere. It is also protective in the case of high voltage wiring. The screen is connected to the system earth. It's important that the screen is as continuous as possible.

It's also important to understand that the earth is NOT the mains neutral or the DC side ground, and that those circuits must not come into contact with the earth else it ceases to be protective. You can think of it as extending the protection of the metal box further down the wire. As a general rule screens are only connected at one end to avoid creating 'ground loops'. The technique I've shown is a good way to connect the screen, avoid creating short circuits and provide some mechanical strength to the connection.