。
She bought her child a toy.
Literal
She [topic-は] child [recipient-に] toy [object-を] bought-for.
~てやる is the benefactive 'do for someone' marker, used when the recipient is in-group or below the speaker in hierarchy — parents to children, masters to subordinates, oneself to oneself. Parallel in shape to ~てあげる but flatter and more familiar in register. The polite ~ました form softens the otherwise blunt-leaning やる. Compare with ~てあげる (favor to a peer or someone above), ~てくれる (favor coming to me), ~てもらう (receiving the favor) — the giving/receiving system encodes who's giving to whom and how the speaker views the relationship.