The first point to note is that 2 strokes do not use conventional inlet and exhaust valves. They use ports (holes) in the side of the cylinder, which are covered and uncovered by the motion of the piston.
The inlet manifold is connected to the crank case and contains a non return (reed) valve which prevents flow reversals. The crank case is also connected to the inlet port.
As the piston moves up in the compression stroke it closes off both of the ports, and so compresses the mixture in the cylinder. This upward motion also draws mixture into the crank case. The mixture in the cylinder is fired close to top dead centre and the expanding gasses push the piston down.
As the piston moves down it tends to pump the mixture out of the crank case. But the reed valve prevents this reverse flow, so the mixture becomes compressed in the crank case.
When the piston is close to bottom dead centre it uncovers the exhaust port and the pressure in the cylinder causes the exhaust gas to start flowing out. A fraction of a second later, the piston uncovers the inlet port, alllowing the pressurised mixture in th ecrank case to flow into the cylinder. The piston crown is shaped such that the incoming mixture helps in pushing out the exhaust gas.
The piston then starts to rise, and the process is repeated.