Target display mode

Target display mode (TDM) allows supported iMac models with a Mini DisplayPort or Thunderbolt interface to function as an external monitor for another Mac.

Support
The iMac functioning as the external monitor must have the same or older display interface as the Mac providing the video signal. iMac models that support target display mode were released from late 2009 to mid 2014; models with Retina displays are not supported. The iMac in target display mode must be running Mac OS X 10.6.1 to 10.13.6; macOS Mojave and later are not supported.

This hardware functionality has been replaced by AirPlay, which allows video signals to be broadcast wirelessly.