They don't particularly 'do' anything. A piece of software would be programmed to do a certain thing when it sees a particular image. ie they could make it do the same thing no matter which card it sees, or have the Zelda one do something different from the Pikmin one depending on the game.
Could I trouble you for some maple syrup to go with the plate of roffles you just served up?
Tag, courtesy of fkusumot: "Why do most of the PS3 fanboys have avatars that looks totally pissed?"
"Ok, girl's trapped in the elevator, and the power's off. I swear, if a zombie comes around the next corner..."