The shields provides two way protection.
First of all the shield helps prevent the device from producing any emissions, (radio, electrical, etc...) that interfere with the operation of other devices.
Secondly the shield helps protect the device from emissions that other devices are allowed to emit.
Exact laws and standards of how much and what types of emissions are allowed vary from country to country. Without the shields these standards wouldn't be met, the device wouldn't get certification and would be illegal to sell.