There is no difference in core of those services, all of them are visual interfaces for file versioning software called git. You can easily use git without any of these services. If you're starting to explore those technologies I personally recommend getting used to git and ssh. You can read more here on how to use git and ssh https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server
Answers:
- Github was initially written in ruby.
- The difference is memory usage, complexity of depoyment, compatibility with github features, maintenence and community support.
- Self hosting depends on various factors like usage preferences, number of users, business requirements, budget, hosting machine processing power, and amount of time you want to spend for maintenence and learning the platform.