When we use these two tenses together, it shows us that the past simple action happened in the middle of the past continuous action, while it was in progress. "I suddenly felt sleepy, while I was studying".
We often use these tenses to show an action interrupting another action. "I broke my leg when I was skiing".