Pins and needles occur when blood flow to a part of the body is restricted, leading to a tingly sensation in that body part.