In order to understand the elastic properties of the thorax in relation to inhalation and exhalation, you should first understand the anatomy of our thorax. The human body contains twelve pairs of ribs (twenty-four total), and in between the ribs are intercostal muscles. Each one of these muscles is innervated by nerves, which are controlled by the brain and allow them to contract/relax. Our ribs essentially serve as a protective cage around our lungs, allowing them to change in size accordingly for ventilation.
When you inhale, the brain sends a signal to the intercostal muscles to contract, which will cause the ribs to move outwards. Similarly, another muscle on the floor of the thorax (called the diaphragm) will also contract and move downward. The net result of this is the expansion of your lungs, which results in net negative air pressure in your lungs; hence, air from outside will flow into your lungs. During this process, your alveoli also expand greatly in volume because they contain a protein called elastin which allows them to stretch, a bit like a balloon. This entire process is called inhalation.
When you exhale, essentially the opposite occurs. Your intercostal muscles, diaphragm, and alveoli will relax and want to revert back to their relaxed state. Continuing with the balloon analogy, the alveoli will shrink as the air leaves on exhalation. As your intercostal muscles and diaphragm also relax, it will cause the lungs to decrease in volume, resulting in a net positive air pressure in your lungs relative to the outside environment, and so air will flow back outward. This step in the process is exhalation.
The elastic structures and properties of the thorax are what allow our lungs to function so efficiently. Without such elasticity, we would not be able to alternate being inhalation and exhalation. The elastic properties are what allow the structures of the thorax to contract and relax on command from the brain and allow us to breathe.