When responding to ownership violations, children can focus on the victim’s needs, the perpetrator’s punishment, or both. Recent studies show that 3- and 5-year olds are equally likely to respond to second- and third party violations, and 3-year-olds return objects to their rightful owners. Children’s interventions are consistent with justice for victims.A "second-party" violation means that the child himself or herself was the victim; a third-party violation means that a puppet was the victim.
Together, these results suggest that although children intervene in loss events experienced by them- selves and others, their interventions are a general re- sponse to any unpermitted loss of property rather than punishment of theft.
Young children remedy second- and third-party ownership violations
Julia W. Van de Vondervoort and J. Kiley Hamlin
Trends in Cognitive Sciences | September 2015, Vol. 19, No. 9
In either case, your basic 3-year old's attitude, with which I completely agree, is: Give it back.
I wonder at what age children start to feel that justice requires punishment? (Or perhaps children at this age innately feel that punishment relates to a different set of wrongs?)
I'm pretty sure I've come across a fair amount of research showing that a desire to see wrongdoing punished is built-in, too.