Row visibility depends on each transaction's snapshot, so an exact count must scan (index-only at best) — estimates live in pg_class.reltuples. count(*) vs count(1) is a myth (identical performance), no VACUUM is triggered, and counting takes no exclusive lock.
Official docs