Git doesn't do that. People needlessly destroying history do that.
Git will happily let you merge branches and preserve the history there. GP seems to like that history being in PRs only on github instead. I don't get why, that just seems worse to me.
The why is that most people when given the merge option don’t clean up their history so you end up with tons of garbage fix up commits.