System and Surroundings in a thermodynamic process

A system in Thermodynamics is defined as an area where a thermodynamic process is taking place. A system has boundaries.

Anything outside the system which may affect the system is called the surroundings.

The system and the surroundings are separated by a boundary.  The boundary may be real or imaginary.  Energy or mass may pass through the boundary from the system to the surroundings or vice versa.

Consider a cylinder in an internal combustion engine.  The gas enclosed in the cylinder is the system, the rest of the engine and the atmosphere is  the system.