Spacing above headings

I’m curious why there is spacing above heading 2 in the screenshot even if I set paragraph spacing to 0. I’m sure it’s intentional but it does seem to be out of place. Personally would love not to have it if I set paragraph spacing as 0.

Screenshot 2023-04-25 at 20.43.46

Gently reviving this. (I’m kinda surprised by the low attraction of this post as this seems to be the implementation in many other text editors such as iA Writer, Ulysses, and even Apple Notes)