Glass shower doors and walls that surround enclosures are typically very hefty. As a result, they must be supported by bolts that are inserted into wall studs rather than just through the drywall.
A glass shower enclosure can come out of the drywall if it is not supported by a stud, which would completely damage the installation.