Blocking screenshots is an OS-level supported feature that Apple and Google had to work to implement. It’s really important for apps that have an expectation of privacy (Snapchat, etc) or for corporate security reasons (Outlook email and such).
It’s not actually difficult to bypass those blocks, but it’s not straightforward for a typical user.