Wow! As far as I can find there is no official documentation which describes how a backup file is created.
Investigating (reverse engineering) why backups failed (and this is from memory) ... sequence ... probably not accurate ... here goes.
The routine first build a plan. Plan consist of backup preferences (includes or not to include) and the contents of the course. Not all backups, therefore, would be the same ... no sense in building a plan for something if backup preferences excludes, I would think.
Last time I visited this .... I picked a farily large course (content wise) started the command line backup and in another terminal screen would find the contenthashed named directory in moodledata/temp/backup/sdlfwdwefadwfafjasfd changed into that directory then used 'watch ls -lR' to see it being built.
The plan, for example, does use a routine for all forums and activities in a course. Builds an xml file and an associated directory. Another for quiz - quizzes.xml and an associated quizzes directory. Another for X.
To see end result and attempt at determining what one sees in the backup log ... those 100, 200, 300,400 ... etc. up to 1000 stages, I'd take the .mbz file and un-tgz the backup, then use ls -lR re-directed to a backupfiles.txt file. In looking at the date/time stamps on files one could figure out what was done first and what was done last. The the very last is files.xml and the files directory.
And the very last thing created is the moodle_backup.xml ... the roadmap to the contents of the backup.
If this helps, great ... if it doesn't .... sorry 'bout that!
'spirit of sharing', Ken