Both APTbackup and PKGbackup works on the same principle. PKGbackup has an option to save the list into dropbox, otherwise it will save the list of tweaks in the contacts application (if you scroll the contacts, you will find one contact with gibberish name. )
APTbackuo does the same thing, it will save a list of your tweaks (the tweak name, the repo where the tweak is downloaded from) and it will save it in a note file. I am not sure where the note file is saved but I'm sure google will let me know.
This note file will be backed up via the normal iTunes backup process.
Once you wipe your iPhone clean and upgrade etc, your jailbreak will be gone. Once you restore the backup file the note (for Aptbackup ) or the contacts (for PKGbackup ) will be restored to the phone as well.
Now the next process is to jailbreak the iPhone (if there is a jailbrek for that particular firmware laaaa). Once the iPhone is jailbroken, cydia would be automatically installed.
The next process is to manually download either PKGbackup or Aptbackup. This is the only manual thing you have to do.
After either PKGbackup or Aptbackup is installed, the app will automatically look for the restored contacts or lists. Once it finds it, all you have to do is press the restore button and PKGbackup or Aptbackup will automatically try and download all the tweaks you had before based on the lists.
That is the concept for both program.