The nuclear membrane is a barrier that physically protects the cell’s DNA from the chemical reactions that are occurring elsewhere in the cell. If molecules that stay in the cytoplasm were to enter the nucleus, they could destroy part of the cell’s DNA, which would stop it from functioning properly and could even lead to cell death. The envelope also contains a network of proteins that keep the genetic material in place inside the nucleus.
It also manages what materials can enter and exit the nucleus. It does so by being selectively permeable. Only certain proteins can physically pass through the double layer. This protects genetic information from mixing with other parts of the cell, and allows different cellular activities to occur inside the nucleus and outside the nucleus in the cytoplasm, where all other cellular structures are located.