Canonical LTD maintains two discrete versions of Unity which are almost indistinguishable from a visual standpoint but very different on the technical level.
Unity is written as a plugin for Compiz and is written in the programming languages C++ and Vala and is utilizing an uncommon OpenGL toolkit called Nux. Being a plugin for Compiz gives Unity GPU-accelerated performance on compatible systems.
Unity 2D is a set of individual applications. They are written in the GUI building language QML from the widespread Qt framework. By default Unity 2D uses the non-compositing Metacity window manager but can also use accelerated window managers like Compiz or KWin.
Since Unity 2D does not talk to a composition manager for transparency effects, some views such as the application launcher are not displayed as semi-transparent window but in full screen applying fake transparency.
Unity 2D will replace the classic GNOME desktop as the fall-back for users whose hardware cannot run Unity 3D, starting with Ubuntu 11.10.