She made an apple pie for her husband.

Literal

She [topic-は] husband [for-に] apple-pie [object-を] made did-for-him.

作ってあげた uses ~てあげる to frame the baking as a favor done for the husband's benefit.