Bates trial : Questions

How did the lawyers knew about the intimate dealings between Bates and his wife that Mrs Hughes had heard. Or the conversation between Lord Grantham and Bates before he goes to London. And to call O Brien and not others ?