With the default on, a commit returns only after its WAL is flushed, which is what makes it durable. Turning it off is faster but a crash can lose the last few commits (the database stays consistent).
synchronous_commit
The PostgreSQL setting that decides whether COMMIT waits until its WAL is flushed to disk.