The prover and the simulator must both be able to generate the proof, but given different inputs. The Prove functionality gets as input the CRS $\sigma$, the statement $y$ and the witness $w$, and outputs $\pi$.
The soundness requirement postulates that nobody should be able to create $\pi$ for $y \not\in L$, given $\sigma$ as an input.
However, zero-knowledge requirement says that simulator must be able to create $\pi$ even without knowing $w$. To get soundness and ZK at the same time, the simulator must get an extra input, which is some trapdoor $\tau$ generated while $\sigma$ was chosen. For example, the trapdoor could be the secret key corresponding to the public key that is contained in $\sigma$. Thus, in the simulation functionality, the simulator gets inputs $(\sigma, \tau, y)$ and outputs $\pi$.
In the real world, the prover does not know the trapdoor and thus must use the Prove functionality. Inside the proof however, while proving that the proof does not leak prover's secret input, the simulator creates $\pi$ based on the simulation functionality. If he can do it, then the ZK property is obvious. It is also obvious that this does not contradict the soundness property.