The infinitival clause there expresses what happens next without any intervening events, and so it can be used to convey a sense of abruptness or surprise:
He rounded the corner to find his brother standing there on the sidewalk and speaking on his mobile phone.
He doesn't round the corner with the intention of finding his brother. Finding his brother is what happens immediately upon his rounding the corner.
It can also be used to convey a sense of that which is relentlessly true:
He shook the iron bars to discover again there was no escape from this prison.
SometimesIn a similar usage, sometimes it is used with the word only and then it conveys the sense of a (recurrent) disappointing result:
He jumped again as high as he could only to fall short of the grapes hanging from the trellis.