These words are used interchangeably, but contain is a synonym only of consist of, not consist in. Consist of and contain express the notion that something so exists that something else can be placed or noticed within it: "The can contains gasoline." "His appeal consisted of his charm, good looks, and honesty." Consist in is used to define an identity, to indicate a quality or ingredient that is possessed by something: "Happiness consists in attaining goals that are desired and then appreciating them." See also compose.
Dictionary of problem words and expressions. Harry Shaw. 1975.