AMCL tries to match the laser scans to the map thus detecting if there is any drift occurring in the pose estimate based on the odometry (dead reckoning). This drift is then compensated by publishing a transform between the map frame and the odom frame such that at the end the transform map->base_frame corresponds to the real pose of the robot in the world. It is explained here with a nice diagram:
here you can find the definitions and uses of each frame for ROS REP105 naming conventions:
Coordinate Frames
map
The coordinate frame called map is a
world fixed frame, with its Z-axis
pointing upwards. The pose of a mobile
platform, relative to the map frame,
should not significantly drift over
time. The map frame is not continuous,
meaning the pose of a mobile platform
in the map frame can change in
discrete jumps at any time.
In a typical setup, a localization
component constantly re-computes the
robot pose in the map frame based on
sensor observations, therefore
eliminating drift, but causing
discrete jumps when new sensor
information arrives.
The map frame is useful as a long-term
global reference, but discrete jumps
make it a poor reference frame for
local sensing and acting.
odom
The coordinate frame called odom is a
world-fixed frame. The pose of a
mobile platform in the odom frame can
drift over time, without any bounds.
This drift makes the odom frame
useless as a long-term global
reference. However, the pose of a
robot in the odom frame is guaranteed
to be continuous, meaning that the
pose of a mobile platform in the odom
frame always evolves in a smooth way,
without discrete jumps.
In a typical setup the odom frame is
computed based on an odometry source,
such as wheel odometry, visual
odometry or an inertia measurement
unit.
The odom frame is useful as an
accurate, short-term local reference,
but drift makes it a poor frame for
long-term reference.
base_link
The coordinate frame called base_link
is rigidly attached to the mobile
robot base. The base_link can be
attached to the base in any arbitrary
position or orientation; for every
hardware platform there will be a
different place on the base that
provides an obvious point of
reference. Note that REP 103 [1]
specifies a preferred orientation for
frames.
Relationship between Frames
We have chosen a tree representation
to attach all coordinate frames in a
robot system to each other. Therefore
each coordinate frame has one parent
coordinate frame, and any number of
child coordinate frames. The frames
described in this REP are attached as
follows:
map --> odom --> base_link
The map frame is the parent of odom,
and odom is the parent of base_link.
Although intuition would say that both
map and odom should be attached to
base_link, this is not allowed because
each frame can only have one parent.