Leveling a sub floor or concrete pad prior to the finished floor going down is crucial to getting a great finished product.
There are many different ways to do it but these are just a few different scenarios that commonly come up and how to address them.
Typically the most common problem is sagging floor joists so that they create a bow or another typical problem is one part of the house has settled but not the rest.
If it is an older home like in the photo shown above replacing undersized joists that have sagged or cracked was the only option. If the sag isn't that severe you can sister or join two joists side by side to then put the subfloor on the level joist. Lastly in this type of situation you can take measurements and cut custom strips or shims to add where there is a dip.
In a bathroom or a basement that is unlevel a self leveling underlayment can be used. The self leveling underlayment is a very viscous thinned out concrete that like water will go to the lowest point where it is poured. It is a great option is you are putting down tile or type of floating floor that doesn't need to be nailed down. Think great for tile or LVT flooring but not so much for hardwoods.