Can an old iMac become a second monitor?
Yes, when the iMac is still compatible with macOS 12.3 or later. Install Beyond Display on both Macs, connect them locally, and use the iMac as an extended second monitor instead of buying another external display.
This is different from Apple Target Display Mode. Beyond Display does not unlock unsupported legacy iMac hardware, and it does not turn every old iMac into a monitor. It works when the iMac can still run the required macOS version.