to make a defense in words: to answer an accusation or a challenge by stating one's case
This is a courtroom word, and it never stops being a speaking word. Someone has brought a charge, and the accused takes his turn and answers it: not by fighting back, not by saying sorry, but by laying out the reasons he is in the right. In Greek courts it was the ordinary term for the defendant's reply, the exact counterpart of the prosecutor's accusation.
Most of its appearances in the New Testament are real trials. Paul answers charges before the governor Felix, before Festus, and before King Agrippa, and Jesus tells his followers that when they are dragged before councils and rulers they should not rehearse a speech in advance. But the same verb also covers a defense with no judge in sight: a man trying to get a hearing from a rioting crowd in Ephesus, and Paul asking the Corinthians whether they have been reading his letter as a plea for his own reputation.
The noun built from it (ἀπολογία) names the defense itself, the speech or the case that gets made, while this verb names the act of making it. It stands near the ordinary verb for answering (ἀποκρίνομαι), but it is narrower: this one answers a charge, not merely a question. It also stands near the verb for bearing witness (μαρτυρέω), but a witness may speak with nothing at stake, whereas this word always comes after an objection has been raised.
One passage turns the picture inward. Paul describes the thoughts of people who never had the written law arguing back and forth inside them, some bringing charges and some speaking up for the defense. The trial imagery is doing the work: conscience holds a hearing.