Usually, Reimu is heavily pounding and punishing Yukari for causing shit like this to other people. This could be an easy way to explain how they got to that point. But this boy ruins that thing.
So technically speaking somehow in this series Reimu was split into two bodies and Yukari wanted to get those bodies back into one through some method and the way it ends makes sense.