She bought her younger sister a dictionary.

Literal

She [topic-は] younger-sister [to-に] dictionary [object-を] bought gave.

妹に辞書を買ってやった — やった marks the casual benefactive: 'bought as a favor.' に marks the recipient.