$rootScope is the top-most scope in AngularJS apps and is shared among all components. $scope binds a view to a controller's model and functions. Scopes are hierarchical, with $rootScope at the top and all other scopes as its children. The example demonstrates defining values on $rootScope and $scope, and how they can be accessed within and outside controllers depending on the scope.