In nature, substances can exist as solids, liquids, gases, or plasma. Transitions between these states are called phase changes, and take place under certain pressure and temperature conditions. Sublimation and deposition are two types of phase changes which, by definition, are the opposite of each other.
Sublimation is the phase change that occurs when a substance goes directly from a solid to a gas. When sublimation occurs, the substance does not go through the liquid phase. Energy is required for a solid to sublime into a gas. In nature, the heat produced by sunlight is usually the energy source. An example of sublimation is how dry ice reacts when exposed to an average room temperature and pressure. Dry ice is carbon dioxide that was solidified through a complex process involving condensation into a liquid at very low temperature and high pressure and subsequent release of the pressure, which causes rapid evaporation of about half of the liquid CO2, providing enough energy to freeze the remaining liquid into solid CO2, or dry ice. When exposed to normal atmospheric pressure and temperature, dry ice sublimes into vapor.
Deposition occurs when a substance goes directly from the gas state to the solid state. Like sublimation, the intermediate liquid phase is skipped over. In contrast to sublimation, the process of deposition releases energy. An example of deposition is the formation of frost. In cold temperatures, water vapor undergoes deposition to form a thin layer of solid ice on plants and grass.