Apple added Activation Lock several years ago to its iPhones as a theft deterrent, partly at the request of users and partly because law enforcement insisted it would reduce the incentive for grab-and-run theft. The idea was that even if an iPhone were stolen and wiped, the device would refuse to allow a new installation without the Apple ID and password for the account that originally registered it being available to unlock it.
Activation Lock is turned on by enabling Find My in Settings > account name > iCloud. Disabling Find My requires the same Apple ID login that turned it on. It’s now also available on an iPad, iPod touch, Apple Watch, and any Mac with the T2 security chip that enables Touch ID and other features. On a Mac, use the iCloud preference pane in macoS 10.14 Mojave and earlier and the Apple ID preference pane starting in 10.15 Catalina.