An ordinary chess program, animated. The branch at the end is a thought experiment, not something chess engines do.
The program above can only move chess pieces. Imagine instead a system whose possible actions reached beyond the board, to the computer it runs on, the network and its own settings, and which was strongly optimizing for the single objective of winning.
The same reasoning that protects the queen would, in principle, favor a few subgoals that help with almost any objective. Researchers call this pattern instrumental convergence.
Protecting a queen to win requires no fear, and behaving in ways that preserve an objective is not evidence of consciousness.
The idea: Omohundro 2008, "The Basic AI Drives"; Bostrom 2012, "The Superintelligent Will". This branch is an argument about incentives, not a description of any real chess engine or AI model.