The palette, as well as possibly other palettes for other images, is loaded into a piece of hardware called a color lookup table (CLUT).
The image is mapped so that each pixel in the image is assigned a number pointing to one ofthe colors in the palette.