Outer 囗 is the big enclosure radical (wéi, not the small mouth 口) — four walls around an inner space. Indexing radical of 围, supplying the meaning directly: to surround, encircle. Family: 国, 园, 圆, 困 — all chars where 囗 wraps something inside.
Inner 韦 supplies the sound (wéi → wéi, identical) — an unusually clean phonetic match. 韦 itself originally pictured feet circling a position (a sentry going around); that 'going around' image faintly reinforces the surrounding meaning of 围. Same phonetic appears in 伟 (wěi, great) and 违 (wéi, violate).