Understand by Explaining or Learning by Teaching

Usually used in software engineering. Programmers explain the code to a rubber duck or any other inanimate object to debug their program. When they explain the code line by line and what it does, they sometimes have a eureka moment. It helps them understand their code better.