thereupon; just then; at that moment
Used after the plain past or non-past form of a verb to indicate that something happened right at that time, often with a nuance of timing or opportunity. Similar to ~たところへ or ~ているところへ.
出かけようとしたところへ電話が鳴った。
Just as I was about to leave, the phone rang.
困っているところへ友達が助けに来てくれた。
Just when I was in trouble, a friend came to help.
ところに is similar in meaning and often interchangeable, but ところへ may emphasize direction or arrival of an event.
From 所 (ところ, 'place' or 'moment') + particle へ (direction). The temporal use developed from the spatial sense of 'to the place where something is happening'.