If temperature and pressure are both the kinetic energy of the molecules, how are they different?The short answer is that temperature, pressure, and kinetic energy are three different things. But most of the time, as one increases, the other two also increase. As one decreases, so do the other two.
This relationship is contained in the famous ideal gas law:
So given a constant amount of gas in a container of constant volume, the pressure is proportional to temperature.
Somewhat less well-known is the Equipartition Theorem:
So given a constant amount of gas, the kinetic energy is also proportional to temperature.
But the ideal gas law and the equipartition theorem do not define temperature, pressure, or kinetic energy. Each one has its separate definition, and the relationships between them must be derived from other principles. Therefore, it makes sense to say that there are some situations where the relationships between the three are less clear-cut. As it says in the name, the ideal gas law is an idealized model of gases, and it may not hold true if there are further complicating factors. For example, if the gas is so dense that it condenses into liquid nitrogen, then the ideal gas law is obviously not going to hold.
In the longer explanation, I would have to actually explain what these three things are. In order from simplest to most difficult.
Kinetic energy is a measure of how much energy is in the motion of the molecules. If the molecules are moving around, or if they are spinning, or if they are vibrating, this all contributes to the kinetic energy. Note that kinetic energy is not exactly equivalent to motion. If a single atom of mass m is moving with speed v, the contribution to kinetic energy is:
Pressure is the amount of force that a gas exerts on the walls surrounding it, divided by the area of the wall. Pressure is caused by molecules physically bumping into the walls. Faster molecules will not only bump into the walls more often, but also exert more force on the walls when they do bump into them. So clearly, the greater the kinetic energy, the faster the molecules are moving, and the more pressure the gas exerts on the walls.
But obviously some kinds of kinetic energy are not going to contribute to pressure at all. If the molecules are rotating or vibrating, for instance, that doesn't make them bump harder into walls at all. If the molecules are moving parallel to the walls, that doesn't contribute to pressure either. The only reason we can say that the kinetic energy is proportional to pressure is because the kinetic energy naturally distributes itself evenly among all the different subtypes of kinetic energy, provided that you divide up the subtypes the right way. In the equipartition theorem, f represents the number of different subtypes of energy.
An interesting aside is that one of the earliest lines of evidence for quantum mechanics came from this framework. At high temperatures, the kinetic energy of air gets distributed among motion, rotation, and vibration. But at room temperature, a greater fraction of the kinetic energy is in motion, because the molecules don't vibrate. Ultimately the explanation came from quantum mechanics, which says that there are discrete energy levels of vibration. Only at higher temperatures is there sufficient kinetic energy to overcome the jump between the first and second energy levels of vibration.
The last concept that needs explaining is temperature. Ehh... Temperature will take much longer to explain, so I'll leave it for next time. It's a strange thing, of the three concepts, temperature is the most tangible. You can literally touch and feel temperature. But it's the hardest to physically define. In contrast, kinetic energy is simple to define in terms of mass and speed, but has more abstract significance.
Update: The next part about temperature is here.