It nominally is because at "20 degrees" the flaps are deflected downward 20 degrees from their raised position - same thing for 10 degrees, 30 degrees, etc.
The angular measurement is somewhat arbitrary because the reference line for measurement can be different places on the flaps, and there are several different types of flaps, some of which translate as well as pivot when they move.
For each specific aircraft, the manufacturer will have performance data based on tests with the flaps at each setting.