Ventilation means moving air into and out of the lungs. This depends on a number of factors which we can break down and talk about individually.
The structure of the thorax: An airtight space in the body that contains the lungs. It is surrounded by the ribs, the accessory muscles and the diaphragm.
The pressures in the thorax: These are changed by the structures of the thorax, the ribs and the diaphragm. The diaphragm is a flat muscle, when it contracts, it flattens out which increases the space in the thorax. The intercostal muscles between the ribs also contract, pulling the ribs up and out. This also increases the volume of the thorax.
The increased space in the chest causes a drop in pressure, which causes air to be drawn into the lungs.