all of your cells constantly display proteins in their MHC class I molecules, infected cells present their insides to the outside world, even if they don’t “know” that they are infected! The display-window thing is an automated process that always happens in the background as part of the normal life of your cells. If an immune cell wants to check if a cell is infected, it simply can move closer and peer into the little “windows” to get a snapshot of the inside. If it recognizes things in the windows that should not be inside the cell, the infected cell will be killed.