Body states become linked to outcomes of events in the world. When something bad happens, the brain leverages the entire body (heart rate, contraction of the gut, weakness of the muscles, and so on) to register that feeling, and that feeling becomes associated with the event.