Static shock occurs when two objects with different electric charges come into contact or are rubbed together, causing a transfer of electrons. This can create a sudden and sometimes painful shock, especially in dry environments. Static electricity is commonly experienced in everyday life, such as when walking on carpets or touching a doorknob after shuffling across a rug.