Why do guys playfully punch girls on the shoulder?

When I had to pair up with my ex for a project (we ended on good terms and after a few months we starting talking and became friends again) he would find any opportunity to punch me on the shoulder playfully like if something good happened or we finished a task. I asked a friend who has known him for 6+ years and she said she hasn't seen him doing that to other people,,

Why do guys playfully punch girls on the shoulder?
Post Opinion