A courtroom is a power play. Everyone is trying to win. The judge is in charge, and his job is to keep order. Each lawyer is trying to win, and so are their witnesses.
Judge Taylor “was a man who ran his court with an alarming informality” (ch 17), and he was always paying attention even when it seemed like he wasn’t. He ordered witnesses to answer when they get reluctant, and kept a careful eye on what the lawyers were saying too. He also needed to keep the audience under control, such as when Bob Ewell said use language that was offensive when describing Tom Robinson raping Ewell.
So serene was Judge Taylor's court, that he had few occasions to use his gavel, but he hammered fully five minutes. (ch 17)
The judge has power to keep order, but the lawyers have the power to ask questions. Their cross-examination of the witnesses is intended to make the jury accept their version of the facts.
For example, when Atticus got Bob Ewell to write so that it was clear that he was left-handed, after establishing that a left-handed person hit Mayella, Mr. Gilmer re-directed the witness and tried to get him to say he wrote with both hands.
Mr. Gilmer asked him one more question. "About your writing with your left hand, are you ambidextrous, Mr. Ewell?" (ch 17)
This power play was basically pointless though. The jury’s guilty verdict was a foregone conclusion. Atticus did his best anyway. He had power in the courtroom because he was respected, despite who his client was and the prejudice against him.