The cell membrane is permeable. Meaning things are able to pass through it. The cell needs certain substances to function and gets them through the membrane.
The cell wall is much like Trump's wall, or Hadrian's wall. It provides for protection and structure.