How do gram positive bacteria protect themselves against harsh environments?

because they have very thick layers of peptidoglycan.