'But since a coral snake's bite invariably leads to death, there is NO lesson to be learned, someone finally realized.'
Not so. Whilst it may be that an individual animal cannot learn this lesson, the species as a whole can, due to genetic variation between its members. Those that have a higher genetic predisposition to approach scarlet snakes are more likely to die before procreating. The species as a whole may thus develop a genetic tendency to avoid scarlet snakes which becomes more pronounced with each successive generation; ie. the lesson is progressively. 'learned'.