Past Simple vs Past Continuous
The past continuous is very often used with the past simple to say that something happened in the middle of something else.
The single event (past simple>when) happens in the middle of a longer action (past continuous>while) also called background action.
I was walking, when a pidgeon attacked me!
While I was walking, a pidgeon attacked me!