The domestic cat’s ancestor, the North African wildcat evolved to learn that looking like a snake when snoozing helped to protect it. This was a learned process from their inherent fear of the snake. They recognised that the snake was dangerous and through evolution evolved to look like one themselves when they were in a vulnerable position