This common expression is used to remind us that what we do has consequences, and our negative actions can come back to hurt us, and our positive actions can benefit us later on.
Jeffrey stole some candy from the shop this morning, but some bullies stole it from him that afternoon. I told him what goes around, comes around.