Gatekeeper

Gatekeeper is an anti-malware feature of the macOS operating system. A user with administrator permissions can access the feature through the Security & Privacy pane of System Preferences.

History
The feature first appeared in Mac OS X 10.5 (Leopard) as File Quarantine. It was expanded in Mac OS X 10.6 (Snow Leopard) and became Gatekeeper in OS X 10.8 (Mountain Lion). Gatekeeper allows users to restrict which sources they can install applications from in order to reduce the likelihood of inadvertently executing a Trojan horse. There are three options: allow only applications downloaded from the Mac App Store to be launched, allow applications downloaded from the Mac App Store or certified by identified developers to be launched, or allow all applications from Anywhere to be launched.

Disabling Gatekeeper
Starting in OS X 10.11 (El Capitan), the Security & Privacy preference pane began hiding the option to allow apps downloaded from Anywhere. This can be allowed on a one-by-one basis through the preference pane, or re-enabled with the following Terminal command: (both steps require admin access)

sudo spctl --master-disable