Angular uses dependency injection. $scope is an injected value. It is essentially an object containing all of the ng- references inside of the relative controller for that module.
"A module is a collection of services, directives, controllers, filters, and configuration information." -angular source
When you access something from the collection a module contains, the scope of that access is injected. For example, when a module is created, the module creates a controller property
/**
* @ngdoc method
* @name angular.Module#controller
* @module ng
* @param {string|Object} name Controller name, or an object map of controllers where the
* keys are the names and the values are the constructors.
* @param {Function} constructor Controller constructor function.
* @description
* See {@link ng.$controllerProvider#register $controllerProvider.register()}.
*/
controller: invokeLater('$controllerProvider', 'register'),
This property is registered with the controllerProvider.
The controller is injectable (and supports bracket notation) with the following >locals:
*
* * $scope - Current scope associated with the element
So when you are using this code
phonecatApp.controller('PhoneListCtrl', function($scope){
What you are doing is accessing the 'PhoneListCtrl controller from the controller provider, and then the function provided is called with the associated scope stored with the PhoneListCtrl for that module.
With specific regards to the variable name $scope, the reason that angular can tell if you are using this "keyword" is through a regex process. If you use .toString() on a function it will convert the entire thing to a string, and you can then parse it to see what was in the function. Angular does this,
"The simplest form is to extract the dependencies from the arguments of the function. This is done by converting the function into a string using toString() method and extracting the argument names."
The regex is defined in angular as var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m; You can test using this at https://regex101.com/r/qL4gM8/1

So that is how Angular knows that you used the variable $scope in your function parameters.