Well, first, we need to know the structures of a cell to answer this question properly.
As you may know, a cell contains lots of different structures with different functions, for example, a ribosome, it is an organelle that makes protein for your body. The inside of a cell is separated then by a plasma membrane made out of phospholipids, it protects the inside of a cell by deciding what gets in and what gets out through proteins attached to it and vesicles. The inside of a cell must be always separated from its environment because of the difference in pH levels most of the times, or even to maintain its functions working properly without outside influences.