Cu toate astea = and yet,however
"ca pe un copil" and "ca un copil"
1. ca pe un copil = like you would hug a child => focuses on the action,on the way you hug the child
2. ca un copil = like a child(like a child would hug) => focuses on the person,on the way a child hugs
So basically :
îl îmbrățișam ca pe un copil = I was hugging him just like hugging a child.
Îl îmbrățișam ca un copil = I was hugging him like a child.