Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When the database is restored the pages are read from the backup file and written to the correct location in the new physical database file. Any transactions which were within the transaction log are then read from the backup file and applied to the database file or rolled back. When that is done the database is either brought online or left offline so that other backups can be restored.

When backups are taken the same process is used. All the pages which are within the database file are written to the backup file. Any transactions within the transaction log are then backed up into the file as well.