I think the general argument is that attempting to teach something, forces you to work with the material in your own head in a way that improves your own understanding. This is similar to "rubber duck debugging" where explaining a problem to an inanimate object leads you to the solution. But interacting with an actual human being often helps too.