As I was trying to understand compute shaders, I had trouble grasping how the control flow was handled but I think I finally got it, so in case my understanding might help someone here it is. That should be mostly API agnostic.
For me it clicked when I tried to think about how I would write what a single wave/warp does with pseudo SIMD instructions and execution masks.
If you need some refresher on the confusing vocabulary, I'd recommend the Compute Shader 101 Glossary.