Air has a dew point. That is the temperature at which it can no longer hold all the water vapor that it contains. If the air comes in contact with a surface that is colder than the dewpoint of the air then it will condense on that surface, just like on the side of your beer can.
Objects radiate heat from their surfaces. I radiate my heat towards you and you radiate heat towards me and since we are similar in temperature there is no heat loss to each other. The roof of your barn radiates heat towards space. Space has no heat to radiate back towards your barn. This is called radiant over-cooling.
The roof of your barn on a cloudless night will radiate so much heat towards space that it will cool to as much as 10 degrees f below the temperature of the air. This is why frost forms on the roof when the air temperature is still above freezing.
When you insulate the roof, it will become colder because it no longer gains radiant heat from the ground below it. If the insulation allows the air from below to freely come in contact with the underside of the metal roof, then a significant amount of moisture can collect rather quickly, just like on your beer can.
You can limit the amount of water vapor that comes in contact with the cold surface by using a vapor retarder on the underside of the insulation but you must also limit air movement through the assembly.
The concepts are simple. The solutions can be tricky. The conditions, climate and materials all affect the approach that is effective.
I will add just a few interesting things to consider in helping to understand the concept. Notice that the roof of your car(parked out in the open) will be wet with dew but the sides are dry. This is because the sides are facing other heat radiating objects and the roof is facing space. Cloud cover reduces the radiant heat loss from the roof and ground by re-radiating heat back to the ground. The clouds overhead are cold but not "deep space" cold. Dew doesn't fall, it forms on cold surfaces.
One other odd thing to know. Humid air rises. It is less dense and more buoyant than dry air. This explains part of why airplanes have a harder time taking off in high humid conditions. The reason is that air at a given pressure and temperature only contains a set number of molecules and water vapor is made up of oxygen and hydrogen which are lighter than the oxygen and nitrogen that make up air. The more hydrogen molecules are added to the volume of air, the fewer nitrogen molecules are in that volume. Humid air rises until it reaches a level in the atmosphere where it can no longer hold all the water vapor and at that point it condenses out to form clouds. In a still air building, condensation will tend to occur at the peak of the roof first which is why ridge vents are important in a vented roof system.
Roof ventilation is not the only or even the best way to manage moisture but it is one way. There is no cheap and easy way to do a great job of handling moisture in a metal building. There are cheap ways that may be better than nothing. They may work ok or fail miserably depending on your climate and conditions.
Aren't I just mr. Happy?