Every animal needs oxygen to live- and this includes chicks that are still inside the egg. Humans babies- and the babies of some animals that grow directly inside their mother's bodies- have an umbilical cord that takes in oxygen from their mother's bloodstream, and gets rid of corbondioxide that is produced as waste. But animals babies that develop inside shells have no umbilical cord.
Instead, they depend upon an air sac filled with oxygen that lies between two membranes which are directly under the hard shell of the egg. As the baby grows, it uses the oxygen in the air sac, and releases corbondioxide into it. The carbon dioxide is then released into the air through very, very tiny holes in the shell- and fresh oxygen is taken in too. In this way, a chick is able to breathe and grow.