I've been looking around recently for some easily accessible and reasonably accurate resources on the history of alchemy; there are some but, as one might expect, a great deal of the useless. One thing that seems to be entirely missing is any useful explanation of the medieval view of the four elements. Since this is often misunderstood, I thought I would contribute a few baby steps of progress on this point.
(1) Almost everyone knows the names of the four elements: fire, air, water, earth. What people don't usually grasp is that elemental fire is not identical to the fire we experience, and so forth. Pretty much everyone in the tradition agrees that we never experience pure forms of these, only impure mixtures. If you make a campfire, that is merely a predominance of elemental fire over the other elements; all three of the others are there. Likewise, the air you breathe is not pure elemental air; we breathe in all the elements. And the same is true of earth and water. We never experience the pure elemental versions; they are indirectly inferred from what we do experience.
(2) The elements are themselves explained in terms of something more fundamental, the primary qualities. 'Primary qualities' in this sense does not mean primary qualities in the later sense (shape, size, etc.) but the active dispositions by which the elements manage to do anything at all. These primary qualities are hot, wet (moist/humid), dry (arid), and cold. Any explanation using the elements in medieval accounts can be reduced entirely to an explanation involving these primary qualities. The medieval scholastics are actually pretty forceful about the importance of this: every material explanation of the world is reducible to the operation of the primary qualities. This is not a pure reductionism because they believe that some explanations of the physical world are not material in the relevant sense -- explanations that appeal to the operation of light, for instance, or those that appeal to size, shape, or other quantities. But the greater bulk of physical explanations, and virtually all chemical explanations, were considered reducible to the operation of the primary qualities. Pasnau has a good paper on this point, and notes that this explains a number of features about medieval physics that might be considered odd. For instance, medieval thinkers quite often show that they are perfectly aware that there is a connection between motion of air and sound, or between heat and motion, but they repeatedly refuse to draw the (apparently) obvious conclusion that the one is the other. But the whole move would have looked odd to them: it would from their perspective be like giving up on any material explanation for what obviously seemed to be the sort of thing you would want a material explanation for, or else conflating material explanations with other kinds of explanations, like formal or intentional explanations. Likewise, we see here why the four-elements theory was dominant for so long, why generation after generation of medieval thinkers, often perfectly willing to question other parts of their worldview, take it for granted that physical explanation must be in terms of the four elements: the primary qualities underlying the theory of the four elements were so fundamental to their very conception of certain kinds of physical explanation that there was no way to avoid them. Giving up the primary qualities, and thus the four elements dependent on them, would be like us trying tomorrow to build a physics on the assumption that there are no such things as fundamental forces (gravity, electromagnetism, atomic forces do not exist) or fields.
Each of these primary qualities was a specific disposition to act. Fire has the primary qualities of heat and dry, air has the primary qualities of heat and wet, earth has the primary qualities of cold and dry, and water has the primary qualities of cold and wet. These primary qualities give each elements its characteristic activities.
(3) However, just as we don't have any direct experience of the elements, we don't have direct experience of the primary qualities; they are inferred. There's a sense in which they were thought to show up in our experience -- hot things are those things in which elements with the primary quality of heat predominate, for instance -- but this is what we might call a 'statistical' or 'populational' feature. It is not experience of the primary quality of heat as such, just of the effect of an object that has a lot of parts exercise the heat-activity, enough to predominant over other activities.
This gets us to the single most serious mistake people make when talking about medieval theories of the elements. Heat, Humidity, Aridity, and Cold are not, in this context, the sensible things we intuitively associate the words. They are abstracted from experience and known by inference only. And they really represent kinds of activity. The dispositions for these kinds of activity are transferred from these sensible experiences to activities we do not directly sense.
This goes back to Aristotle, who has some cryptic but influential comments on the point. Heat is the disposition to "associate the homogeneous alone". Cold is the disposition to "associate the homogeneous and heterogeneous alike". These are both (relatively) active qualities. What this means in practice is that heat as a primary quality is the tendency to unite with similar things and expel foreign things. Cold is the tendency to unite with other things regardless of their similarity. The relatively passive qualities are understood along similar lines. Wet as a primary quality is what makes something easily susceptible to taking the shape of other things but not able to confine itself within limits, according to Aristotle; dry is the opposite, easily confining itself within limits but not easily responsive to being shaped by other things. Thus in the context of the medieval theory of the elements, when scholastics talk about 'wet' they mean the tendency to respond to other things by conforming and when they talk about 'dry' they mean the tendency to cohere and retain its character even in the face of environmental factors. When they talk of fire being hot and dry, then, they aren't making a sensory observation. They are saying that something counts as pure elemental fire if its action is exclusive of things other than itself and maintains internal coherence, with no countervailing tendencies. Each element has its own characteristic activity;
Fire: primarily exclusively associating and secondarily cohering in response to external factors
Air: secondarily exclusively associating and primarily conforming to external factors
Water: primarily freely associating and secondarily conforming to external factors
Earth: secondarily freely associating and primarily cohering in response to external factors
One of the difficulties with reading scholastic accounts of the elements is that we keep wanting to read imaginable qualities when talking about fire, air, water, earth, hot, wet, dry, cold, but this is precisely what we must not do. We should read 'hot' as shorthand for 'disposed to unite only with things like itself', 'dry' as a shorthand for 'disposed to maintain its own coherence regardless of environment', and so forth through them all. They no more mean what we usually mean by hot and dry than physicists mean that black holes are ordinary holes that are visibly black. There is, of course, a reason for using these particular terms, one that does connect up somewhere with our ordinary sensory experiences (fire in our sense, for instance, is taken to have sensible heat and driness because of these underlying dispositions), so if you want to say that heat and cold in these senses are sensed in some way that would be perfectly consistent, but it's not a straightforward connection.
The medieval world, then, is one in which material explanations are entirely in terms of attraction and resistance; elemental theory arises from the logically possible combinations of these.
(4) Because the behavior of the elements is explained by their primary qualities, the four elements can change into each other, by changing their primary qualities. Indeed, this is essential to Aristotle's conception of an element: elements change into each other directly, by their very nature. (This is a radically different conception of 'element' than later became enshrined in chemistry.) In principle, any element can change into any other element. However, this is not true in practice; some transformations were usually taken to be very rare, while others were taken to be quite common. To some extent this is common sense. To change fire into water, hot has to be overcome by cold and dry has to be overcome by wet, whereas all that has to happen to change fire into air is for dry to be overcome by wet. Aristotle says that these kinds of transformations do happen, but they are more difficult and take more time, although he doesn't explain why, and there are different interpretations of him on this point.
All this is, it should be said, a bit rough and basic; Aristotle could be read in a number of different ways, and this means that there are subtle differences among different scholastics. Likewise, the medieval scholastics, despite their reputation, were perfectly willing not to stick closely to Aristotle if they didn't want to do so, so there are further variations because of this -- for instance, Ramon Lull introduces all sorts of innovations into his account of the elements. But these points give the basic account of why. And this is sometimes useful to know beyond mere academic interest in the four elements; for instance, medieval philosophers will often use the elements as analogies or metaphors, and having a very wrong view of the elements can lead to misunderstanding of those analogies or metaphors.