How do melting ice caps raise the level of the oceans? if melting ice in a glass of water doesn't overflow it?

Archimede’s principle dictates that the fluid volume replaced by the melted ice is actually less than the ice volume! So, similar to how the melting ice cubes in a glass of water doesn’t cause the water to overflow the glass, then picture the earth as a giant glass of water, and the polar ice caps as the ice cubes.