Thanks! You are right. It is palette swapping the tiles. Let me break it down because I had a lot of fun making that feature and I can link this post when anyone else asks about it.
So first of all, each tile is really 16x16 but I'm draw them with 8x8 tiles to create the smooth edges. For each logical tile (16x16) I store the material in the first 6 bits and the light level in the last 2 (source). That means I can store a light level from 0 to 3. The light is calculated by looking at surrounding tiles in a diamond pattern around that tile (source) and that gets pre-baked for the whole level during level generation at the beginning (when you see the "dialing..." text). Then when you break a tile, it recalculates the lighting for the surrounding tiles (source).
Now we have all the data, we need to render it. The level is 128x128 16x tiles but only a 16x16 window of that data is rendered to the screen with a tile BG layer. For each logical tile, I draw it as 4 8x8 tiles. I take the light level for that logical tile (0 to 3) and for each of the 4 tiles I randomly shift it up or down to make it more noisy and less uniform (source). Then finally that light value is used to pick what palette I set for that 8x8 tile (source).
Here is what the palette looks like for each light level. The third one fades the colors to grey which means you can see there is an ore there but you don't know what the ore is until you start to reveal it.
