Cells have a selectively permeable cell membrane that separates the cell's contents from the outside environment. Substances can enter and exit the cell through diffusion, osmosis, or active transport. Diffusion is the passive movement of molecules from an area of higher to lower concentration. Osmosis is the diffusion of water across the membrane, moving from higher to lower concentration. Active transport requires cellular energy to move substances against a concentration gradient. Photosynthesis captures energy from sunlight to convert carbon dioxide and water into oxygen and sugars.