Pain is a response to a danger signal. We evolved to feel pain so that we can move away from the “danger” (source of pain). Your body has nerves that send messages to your brain about your environment. When you are pinched, the tissue on the pinched area is compressed. Your brain knows that prolonged compression of tissue could lead to tissue damage. (Of course pinching will not kill you tissues). The nerves send the message to the brain and the danger signal in terms of pain is sent out.