A robot with wheel encoders and a laser sensor doesn't know where it is in the environment
and doesn't have its map.
It initializes its pose with respect to an arbitrary global reference frame.
From there, as it moves, it integrates the laser sensor measurements into a grid map.
At the same time, it corrects its pose with the partial map of the environment.
This is required because of the drift in the wheel odometry.
In the end, the robot has a map of the environment and knows where it is through the SLAM process.