Why ubuntu sources are different to the originals?

Ubuntu developers that manage packages and import applications to Ubuntu repositories reserve the right to modify these applications. They are allowed to do so, as almost every software there is free-licenced. They do not try to cover it, these changes are visible to anyone. In fact, they even change the package's version to indicate that it differs from the original release. The apt-get source command you executed downloaded you openssh-server in version 5.8p1-7ubuntu1. Notice the suffix. (You can check the version with any package manager). The scheme orig_version-XubuntuY is very common among all the packages. The X number indicates the revision number in Debian, and Y stands for revision number in Ubuntu. Maybe you know about it, but as a side note to everyone who might read this answer: Most ubuntu packages are copied from Debian repositories - so if Debian developers released version 5.8p1 seven times, releasing it to repositories each time they have included their changes, and, this is the first time Ubuntu developers have released it with their changes, the resulting version number will be 5.8p1-7ubuntu1.

Why would they want or need to include own changes, if the upstream version is good enough?

  • The upstream packages are provided for general audience. However, Ubuntu, as any other distro, has many specific changes, for example a tiny bit different organised file system. In this case any application that uses these parts of system's architecture, that are changed in Ubuntu exclusively, needs adapting to Ubuntu.
    • A good example is that most apps are prepared so that they can work with Apport - the crash detecting and bug reporting tool, that is used in Ubuntu exclusively.
  • In many cases (though not in case of openssh-server) these changes are needed to ensure proper desktop integration. Not many apps are aware of Unity, since it's not common on other distros. This means that if the application should integrate with the indicators, Dash, or whatever else, the Ubuntu developers have to implement this feature and release the app with their changes to the repository.
  • All post-release bugfixes are released as a local (Ubuntu-wide) change to the source. The apps are never updated to a newer upstream release within a single release of Ubuntu. That means that if your Oneiric was released with openssh-server 5.8p1 it will not be updated to 5.9p1 - you need to wait for Precise, or get it yourself. However, Ubuntu provides updates that fix critical bugs and security issues. These fixes has to be applied to the version that's in approprieate Ubuntu series - in your case it's Oneiric - and released as changes done to the 5.8p1 version.
  • Sometimes applications developer's quality requirements are lower then Ubuntu's. From time to time it happens that Ubuntu developers fix a bug in an application before uploading it to repositories.
  • It happens also that the revision number is increased without any changes being introduced. This is the case when an application needs to be rebuild because of significant changes to (or new version of) a library it depends on. Then the revision number is increased just to bump the package version.

You can get more information about the changes at these two places:

  • https://launchpad.net/ubuntu
  • http://packages.ubuntu.com/

There you can find the package you are interested in, choose the version you are interested in, and even download the debian source package to manually read all the .patch files, which are provided by Ubuntu developers and applied to the original source when building an Ubuntu package.

Also notice that these changes are always explained briefly in the package's changelog (available both at these sites and by using most package managers on your computer - but there is the link to your's openssh-server - read it at least to notice how the version number changes as patches are included).

I hope you'll find it clear!