Whenever you are working on a database, and save your changes to Queries, Forms, Reports, etc., Access does two things.
It renames (and hides) the old version.
It saves the changes under the original name.
In addition, deleting rows from the database has a similar effect.
Compact and repair creates a new empty database and copies all of the currently active items in your database, leaving behind the items that have been modified or discarded.