Hiliary Putnam's Twin Earth thought experiment goes like this:
We begin by supposing that elsewhere in the universe there is a planet exactly like earth in virtually all respects, which we refer to as ‘Twin Earth’. (We should also suppose that the relevant surroundings [are exactly the same as for] earth; it revolves around a star that appears to be exactly like our sun, and so on.) On Twin Earth there is a Twin equivalent of every person and thing here on Earth. The one difference between the two planets is that there is no water on Twin Earth. In its place there is a liquid that is superficially identical, but is chemically different, being composed not of H2O, but rather of some more complicated formula which we abbreviate as ‘XYZ’. The Twin Earthlings who refer to their language as ‘English’ call XYZ ‘water’. Finally, we set the date of our thought experiment to be several centuries ago, when the residents of Earth and Twin Earth would have no means of knowing that the liquids they called ‘water’ were H2O and XYZ respectively. The experience of people on Earth with water, and that of those on Twin Earth with XYZ would be identical.
Now the question arises: when an earthling (or Oscar for simplicity sake) and his twin on Twin Earth say 'water' do they mean the same thing? (The twin is also called 'Oscar' on his own planet, of course. Indeed, the inhabitants of that planet call their own planet 'Earth'. For convenience, we refer to this putative planet as 'Twin Earth', and extend this naming convention to the objects and people that inhabit it, in this case referring to Oscar's twin as Twin-Oscar, and twin-earth water as water.) Ex hypothesi, their brains are molecule-for-molecule identical. Yet, at least according to Putnam, when Oscar says water, the term refers to H2O, whereas when Twin Oscar says 'water' it refers to XYZ. The result of this is that the contents of a person's brain are not sufficient to determine the reference of terms they use, as one must also examine the causal history that led to this individual acquiring the term. (Oscar, for instance, learned the word 'water' in a world filled with H2O, whereas Twin Oscar learned 'water' in a world filled with XYZ.)