All discs and consoles have a unique ID.
When you put a disc in a console, Microsoft/Sony/whoever register that disc ID to that console ID. From that point on, so long as the console is connected to the Internet (so it can verify the console-disc ID mapping), it can play the game without the disc.
When you put your disc in another console, the unique disc ID is then registered to that console.
The downside is that it requires an online connection for discless play, and also an online connection for the first time you play a game on the console. The actual process of registering the console will require minimum bandwidth, so it wouldn't be a problem in 99% of households who actually have the means to buy these machines.
People didn't want to have to go online to play a game from disc and I doubt 99% of households with consoles have them connected to the internet 24/7 or at all. Adding a unique disc ID costs extra as well. Much easier is to add a code for a digital copy with each new disc sale. Same way most blu-ray movies give you a digital copy. Register it to your account after installing and done. However publishers have no doubt most gamers would immediately sell the disc afterwards. Hence all these complicated online and registration check procedures.
They could make the ownership of the disc more desirable with extras like with blu-rays. However they don't want to do that, margins on digital sales are simply to good to pass up. This conspiracy theory that retail stores keep digital prices high is just that, a conspiracy theory. Publishers realized that digital is the perfect way to raise prices for the simple convenience of no disc swapping and offering preload on the much desirable pre order business.
Discs have only been made less desirable, flimsy cases, no manuals, no extras on the disc, have to install everything to hdd, no benefits from loading from blu-ray simultaneously next to hdd. The only thing they haven't been able to take away yet is ownership. With a unqiue ID and registering discs to your account, that last major point can be made history as well. It happened to PC games already.