~間に
Something happens within a period of time
You'll be able to place an event at some point while another situation is continuing.

芽衣が寝ている間に、父が帰ってきました。
mei ga nete iru aida ni, chichi ga kaette kimashita.
What do you think this sentence means?
My father came home while Mei was sleeping.
Fit an event inside a period
~間に locates an event or completed action somewhere within a time window. It need not occupy the whole period.
休みの間に、この本を読み終わります。
yasumi no aida ni, kono hon o yomiowarimasu.
I will finish this book during the break.
Form and use ~間に
に turns the interval into a window for an occurrence. Compare 寝ている間、読んでいた with 寝ている間に、帰ってきた: reading continues, while returning happens at a point.
休みの間に、この本を読み終わります。
yasumi no aida ni, kono hon o yomiowarimasu.
I will finish this book during the break.
母が買い物している間に、掃除をしました。
haha ga kaimono shite iru aida ni, souji o shimashita.
I did the cleaning while my mother was shopping.
An ongoing activity or a completed event
間 presents an activity as continuing during a period. 間に places an event or completion within that period.
間
芽衣が寝ている間、本を読んでいました。
mei ga nete iru aida, hon o yonde imashita.
I was reading while Mei slept.
Reading is presented as ongoing while Mei sleeps.
間に
芽衣が寝ている間に、本を読み終わりました。
mei ga nete iru aida ni, hon o yomiowarimashita.
I finished reading the book while Mei slept.
Finishing the book occurs within the time Mei is asleep.
赤ちゃんが寝ている間に、洗濯をしました。
akachan ga nete iru aida ni, sentaku o shimashita.
I did the laundry while the baby was asleep.
留守の間に、荷物が届きました。
rusu no aida ni, nimotsu ga todokimashita.
A package arrived while I was out.
日本にいる間に、富士山に登りたいです。
nihon ni iru aida ni, fujisan ni noboritai desu.
I want to climb Mount Fuji while I'm in Japan.
7 more examples in the grammar path — free for a limited time.