In About Behaviorism, B.F. Skinner says, “Rule-following behavior is said to be the veneer of civilization, whereas behavior shaped by natural contingencies comes from the depth of the personality or mind.” Skinner continues to note, “Doing good because on is reinforced by the good of others (contingency-shaped) is more highly honored than dong good because the law demands it (rule-governed).”
A difference between rule-governed and contingency-shaped is one of knowledge. To understand the rules, we must be taught the rules and commit them to memory and then learn when to apply them. Contingency-shaped behavior is learned because of the reinforcement or punishment that the individual is exposed to by their actions. Their future actions are modified in a way based on that past experience of reinforcement and punishment.
In the case of rule-governed behavior, it is dictated by the stated/written consequences (i.e., the “rule”), not necessarily by consequences that one may have experienced personally. You an tell when a behavior is the result of a rule when there has never been any punishment or reinforcement for the behavior, including automatic reinforcement, but there is a rule in effect. Rule-governed behavior can also be characterized by one instance of reinforcement causing a large increase in the frequency of the behavior, behavior changing without reinforcement, consequences not being immediate, or no immediate consequence is apparent.
Someone learning a language by reading grammar books and memorizing the dictionary (rule-governed) will have a different experience of the language than someone who has learned it from the verbal community (contingency-shaped).