Vacuum does a scan of each table and index looking for rows that can no longer be visible. The row hint bits are updated to reflect any information discovered, and newly freed space is inserted into the FSM.
Once the FSM for a table has entries on it, new allocations for this table will reuse that existing space when possible, instead of allocating new space from the OS.