The correct answer is C: After studying the habits of pit vipers, the pits, which serve as infrared sensors and enable the snakes to seek heat, evolved to detect danger rather than to hunt prey.
A modifier changes or adds more information to something in a sentence. A modifier is considered dangling when is not clear in the sentence what is being modified or the thing being modified does not make sense. In sentence C, "After studying the habits of pit vipers" modifies the noun phrase that follows which is "the pits". So the meaning would be that the pits studied the habitats of pit vipers and evolved. Clearly, this meaning does not make sense as the ones studying the habitats of pit vipers must have been scientists or people.