It comes from the old card game called `Snap` Two people take cards off the top of a deck face down, turn them face up onto a pile and when two the same are turned consecutively, the first person to call `snap` collects all the cards. The game continues until one person has all the cards,or the whole thing gets very silly and out of hand! The latter is most likely!!!!
Hence, the meaning is that two things are exactly the same.