When you walk across a carpet, electrons move from the carpet and into you. If you touch another human being, or any conductor for that matter, the electrons seize this opportunity to leave your body and do so in the form of a shock. The shock represents the electrons leaving your body.
In case you were wondering, more shocks occur during the winter months because the air is very dry during the winter (dry air is an insulator). This dry is conducive to shocks. This dry air causes electrons to stay in your body and, therefore a buildup of negatively charged electrons occurs. During the summer, the moist air (moist air is a conductor) permits the electrons to escape from your body so that you can't build up such a big charge like you can in winter.