external display – My computer restarts when I disconnect the HDMI cable

I have a desktop computer that I build myself.

The computer is connected to a TV from a NVIDIA graphic card with an HDMI cable.

Every time I disconnect the HDMI cable from either, the computer graphic card or the TV, the computer seemingly shuts down.

I don’t know exactly what is happening for sure since every time I disconnect the HDMI cable, I can’t see video output, however, when I connect the HDMI cable again, the computer is starting up, as if I had restarted it (and every program that was opened is now closed, so the computer was not suspended).

Another possibility could be that the computer restarts when I connect the HDMI cable again (rather than when it is disconnected).

I’ve had other computers before and the video display was the same when I disconnected and reconnected the video output from one TV to another.

What could be the problem?