When you prepare to teach a topic to someone else, you will need to identify and prioritise the main concepts that need to be learnt. You give yourself a practical strategy for learning.
Whilst preparing or even in the act of teaching, you will quickly realise the gaps in your own understanding. The bits that you struggle to explain indicate gaps in your understanding. Teaching exposes the gaps in your understanding very quickly so that it’s difficult to have an illusion of learning.