GitHub didn't invent anything. They only made a better UI.
SourceForge was more oriented toward software users. It handles the distribution of binaries. Imagine a time when 90% of software sites would redirect you to sourceforge to download them. Distribution was first. The repo and the issue tracker were in a secondary tab.
GitHub is oriented toward developers. It shows you the repo as the main page. You can't distribute binary releases (well, it was added recently).
GitHub took over by attracting developers right at the start of the project. They need a repo, here it is. UI is nice, site works. The new projects eventually become well known and carry the reputation.
SourceForge went downhill slowly with their shady practices. Ads, confusing pages and software repackaged with adware.