The organs that bring air into contact with blood so that oxygen can enter and carbon dioxide can leave. They achieve this across a surface roughly the area of a tennis court, folded into the chest.

Air enters through the nose or mouth, passes the pharynx and larynx, and reaches the trachea, which divides into two main bronchi, one to each lung.

Each bronchus divides repeatedly, into bronchi, then bronchioles, through roughly twenty three generations of branching, ending in alveoli. The branching is why the total cross-sectional area increases enormously even as individual tubes narrow, so airflow slows to almost nothing at the far end, which is what allows exchange by diffusion.

The alveoli are the working surface. There are around three hundred to five hundred million in an adult, giving a total area usually estimated between fifty and eighty square metres. Each is wrapped in capillaries, and the barrier between air and blood is around half a micrometre thick, thin enough for gases to cross rapidly by diffusion alone.
The right lung has three lobes and the left has two, the asymmetry accommodating the heart.
The lungs have no muscle of their own and cannot inflate themselves. Breathing is done by the diaphragm, a sheet of muscle below them, assisted by the muscles between the ribs.
When the diaphragm contracts it flattens and moves down, enlarging the chest cavity. Because the lungs are held against the chest wall by a thin film of fluid in the pleural space, they expand with it, pressure inside falls below atmospheric, and air flows in. Relaxation reverses the process, and quiet exhalation requires no muscular effort, being driven by the elastic recoil of the tissue.
The system depends on the pleural space remaining sealed. If air enters it, through injury or spontaneous rupture, the lung collapses away from the chest wall, which is a pneumothorax.
Surface tension in the fluid lining the alveoli would tend to collapse them, and pulmonary surfactant, treated in the surface tension capsule, counteracts this. Its absence in premature infants causes respiratory distress syndrome.
Oxygen crosses into the blood and binds haemoglobin in red cells. Carbon dioxide crosses in the opposite direction, carried in the blood mostly as bicarbonate rather than dissolved as a gas.
Breathing is regulated by the brainstem, and the primary signal is not oxygen. Receptors respond chiefly to carbon dioxide, detected through the resulting change in blood acidity, and oxygen sensing becomes important only when levels fall substantially.
This has a practical consequence. Breath-holding is ended by rising carbon dioxide rather than by falling oxygen, which is why hyperventilating before a dive is dangerous: it lowers carbon dioxide, delaying the urge to breathe past the point at which oxygen becomes inadequate, and can produce loss of consciousness underwater without warning.
An adult at rest moves around half a litre per breath, some twelve to twenty times a minute, and can increase that many times over during exertion.
The airways are exposed to whatever is in the air, and are protected accordingly.
The lining bears cilia, fine hair-like projections that beat continuously and move a layer of mucus upward toward the throat, carrying trapped particles with it. Smoking paralyses and destroys cilia, which is why the escalator fails and a cough is needed instead.
Coughing and sneezing expel material forcefully. Macrophages within the alveoli engulf particles that reach that far.
Asthma is reversible narrowing of the airways with inflammation and excess mucus. Chronic obstructive pulmonary disease is largely irreversible airflow limitation, usually from smoking or from long-term exposure to smoke and dust.
Pneumonia is infection of the alveoli, which fill with fluid and cannot exchange gas. Tuberculosis remains among the leading infectious causes of death worldwide.
Lung cancer is the leading cause of cancer death globally, and smoking is the dominant cause. Pulmonary embolism, a clot blocking the pulmonary circulation, blocks blood flow rather than airflow.
The lungs solve a problem of scale: diffusion works well over a fraction of a millimetre and not at all over a metre, so a large animal must bring air and blood into contact across an enormous surface and then transport the result. Nearly every feature of the organ, the branching, the thinness of the barrier, the surfactant and the separate pump, follows from that requirement.