A consequence is something that results from an action, whether intended or unintended. For example, a consequence of stealing cookies is that one can eat the cookies, a consequence of eating cookies is that one has the cookies in one's stomach, and so on.
A consequence is, by definition, always caused by the original action, but will not necessarily occur, it "may" or "may not" come. For example, a possible consequence of running by a pool may be to slip and injure oneself when falling on the hard tiles, though not everybody who runs will slip, and not everybody who slips will get injured.
Most consequences are "natural", i.e. they come by themself. Thus, people have the choice of either doing something, and accepting the (certain or possible) consequences, or not doing it. Humans and higher animals who have a cerebrum have the ability of learning, either from experience or from observation, and can thus make conscious decisions about their actions in order to maximize the positive consequences and to minimize the negative ones.
However there may be cases where a natural consequence is positive, but society considers the action that led to it bad. In such cases, society typically takes an influence by introducing an artificial negative consequence which outweighs the positive natural consequence, such that a person who is able to learn will avoid the action. This is the principle of punishment. The action which is considered "bad" is then called an offense, a sin or a crime. In some cases, society may not punish the person themself, but nurture the belief that there will be a negative consequence in an afterlife (hell, purgatory, bad karma leading to a poor rebirth, restlessness of the soul, or no afterlife at all, etc).
In other cases, society may consider a specific action good, but the natural consequence is not, or not enough, positive in its eyes. In such cases, there may be introduced an artificial positive consequence, known as a reward. The action is called a "good deed" and regarding an afterlife, society will nurture the belief in a positive consequence (such as heaven, an afterlife as such, good karma leading to a better rebirth, a step closer towards nirvana, etc.)
Parenting and education involves teaching a child right from wrong behavior (based on the morality of the parents, their religion, and that of the current local society). Parents will usually want the best for their children and therefore teach them how to get positive natural (and societal) consequences, and how to avoid negative natural (and societal) consequences. To this end, they will often make use of small rewards and punishments, such that the child will learn to be good and to avoid bad behavior that would lead to worse consequences when it has grown up.
A punisher may emphasize the fact that the punishment is actually a consequence of the bad action, which makes it seem less arbitrary and more like a natural consequence - if you do it, you pay the price for it, and that's all.