She was surprised when she heard the news.

Literal

She [topic-は] news [object-を] heard-and was-surprised.

聞いて is the te-form of 聞く linking the cause ('hearing the news') to the emotional reaction ('being surprised'). The te-form is one of the most flexible connectors in Japanese — here it's specifically the cause-and-emotional-result use, parallel to 会えて嬉しい ('happy to meet') or 知って驚いた ('surprised to learn'). 驚いた is past plain of 驚く.