Bottom indexing earth radical
土 — pictograph of a clod of soil on the ground. Stacking in ancient China meant building earthen ramparts and walls, so the earth radical anchors
垒 in the construction family alongside
城 (wall),
坚 (firm),
堆 (pile),
基 (foundation). The military "rampart" sense (
堡垒 fortress) is the most concrete usage today.