Pupils dilate (mydriasis) during stress much the same way they dilate in response to attraction: to gather more visual information about a situation.

Fact source