Well, it actually doesn't, at least not reliably. With the ability to retroactively alter history, you can never be 100% sure that someone didn't sneak a change into the repository without reviewing every line of every diff. Have fun!
You can rewrite history, but it will break compatibility with any forks or mirrors of the repository - and for popular github projects, there are hundreds or thousands of those. No way to alter commits that have already been published without making it very obvious.