Right side
必 supplies the sound: bì → mì with regular b/m alternation in older Chinese.
必 also appears as phonetic in
泌 mì (secrete),
蜜 mì (honey),
谧 mì (quiet) — a tight phonetic family. Adds faint semantic weight too:
必 means 'must, certain', and a
秘密 (secret) is something that absolutely must not leak.