Condensation of water occurs when a surface temperature is lower than the dew point temperature of the surrounding air.
Air inside your home contains a certain amount of invisible water vapor. When air is hot, it can hold lots of water vapor. As the air cools, it holds less water vapor. Water vapor will condense out of air as liquid when the air temperature dips below the dew point temperature.

Think about a rainstorm. What always happens before it rains? A cold front moves in and cools the air below the dew point, and then water condenses in the air and falls as rain.
Why does water form on the outside of that iced tea glass in the summer? The surface of the glass is colder than the dew point temperature of the air. Invisible water vapor condenses as drops of water on the surface of the cold glass.
What can you do about problem condensation in your home? Reduce the moisture level in the air through air conditioning or dehumidification. Or raise the surface temperature of the problem area: for windows, open the curtains, remove interior screens, or increase the airflow around the window.