In the Alpine town of Arbedo-Castione, Switzerland, an electric-blue, 400-foot-high crane with six heads lifts a block of compacted soil into the air and carefully adds it to the top of a stack.

Later, the crane will reverse that process, generating power as gravity lowers the block back toward the ground.

Energy Vault, the company that built...