Good question. The internals should give a clue, make a schematic + pictures of what you see and bring it here.
Many good modern chargers are discarded because as you say, need to detect the battery-to-be-charged is healthy, and refuse to work connected to a dead piece of junk residing years under backyard trash.