Phonosemantic compound. 厂 represents the meaning and 猒 represents the sound. Original form of 壓 (press, push down), related to packed-earth construction of buildings (厂).
The outer walls of buildings in premodern China were filled with earth that was packed down (壓). This is one of the cases where the forms of 广 (building) and 厂 (cliff) were used interchangeably to mean the same thing.
厂 hints at the original meaning of 厭, "to push down on", which is no longer the most common meaning of 厭 in modern Mandarin.