Waitgroups are used to wait for a collection of goroutines to finish their execution before proceeding.