Phonosemantic compound. 宀 represents the meaning and 祭 represents the sound. Based on the original meaning "eaves". The meaning later shifted to "observe from above", "examine", and "inspect".
察 and 祭 don't sound similar in modern Mandarin due to historical phonetic changes. They were more similar in older Chinese.察 /*[tsʰ]ˤret/ 祭 /*[ts]et-s/, /*[ts](ˤ)re[t]-s/