Picture counting on an abacus: 1, 5, 1, 10 — going through numbers step by step without skipping any. This captures the idiom's meaning of thorough, systematic recounting.
history
The idiom derives from the traditional Chinese method of counting by fives and tens on an abacus. Counting in this orderly fashion became a metaphor for narrating something completely and systematically.