As the name implies, the PCB mounting holes help secure the PCB to the housing. However, this is its physical and mechanical use. In addition, in terms of electromagnetic functions, the PCB mounting holes can also be used to reduce electromagnetic interference (EMI). EMI-sensitive PCBs are usually placed in metal enclosures. In order to effectively reduce EMI, the plated PCB mounting holes need to be connected to the ground. After this grounding shield, any electromagnetic interference will be directed from the metal enclosure to the ground.
The common question that the average novice designer asks is which ground do you connect to? In common electronic devices, there are signals, housing bases and grounding. As a rule of thumb, you cannot connect the mounting hole to the signal ground. Signal ground is the reference ground for electronic components in circuit design. It is not a good thing to introduce electromagnetic interference into it.
You are connecting to the housing chassis ground. This is the meeting point for all ground connections of the cabinet. The chassis ground should be connected at one point, preferably through a star connection. This avoids causing ground loops and multiple ground connections. Multiple ground connections can cause a slight voltage difference and cause current to flow between chassis grounds. Then ground the chassis to ground for safety measures.