A moving robot needs to know how far it has travelled. Encoders on its wheels or joints count rotation precisely, and from those counts the robot estimates its change in position, a method called odometry. Over short distances it is accurate and cheap.
Its weakness is accumulation: small errors, from wheel slip or uneven ground, add up over time, so the estimate drifts further from reality the longer it runs uncorrected. That is why odometry is usually combined with other sensing that periodically re-anchors the robot's true position.