What is SQL Server doing in the background once a Backup/Restore is complete? When I run a backup or restore through the SSMS GUI, the dialog shows Executing with 20% increments rather than every 1% tick. To get round this, we can use DMV's. Thing is, when the query shows 100% complete, the SSMS GUI remains for a good 5 or so minutes before the 'Restore complete' dialog appears. 

Question is, what is SQL server doing during this time? Some kind of integrity check? Index rebuild? Activity monitor shows 0 R/W on the .MDF whilst the GUI dialog persists.
Database restore process is performed in 3 steps:


copy -Copy data from the backup
redo - commit completed transactions in T-Log
Undo - Rollback incomplete transactions


Restore process doesn't perform any maintenance tasks like index rebuild etc.


  When I run a backup or restore through the SSMS GUI, the dialog shows
  Executing with 20% increments rather than every 1% tick.


If you have used T-SQL statements to backup your database, you would have been aware of STATS parameter. It take int as input and prints what % of the backup have been processed.

Ex:-

If we use STATS=5 then it'll print restore status after every 5% completion. Like 

5%
10%
15%
..


Post database restore it's good practice to execute DBCC CHECKDB. I would prefer to use PHYSICAL_ONLY.

When a log is restored, it also takes some time to zero out the log file.  If the log file is large, this can take several minutes.