ところ＋particle(助詞) precision


Hy, I am currently working on with 新完成マスター N3 for my grammar part and I get
stuck on a small section of the lesson related to ところ(~p.17)。

So far, I understand that, according to this lesson, ところ can be used to
express something that just, will or be happening soon.

However, I do not get the point of the particles added after. I can understand
why we would use _ところで/ ところだ_ 、but not why we would use _ところを/ ところへ_ 。

Here are the 2 sentences use as an example that I don't quite get the use f
the particle:

  1. ケーキができ上かった **ところへ** 子供たちが帰ってきた。
  2. 試験中、隣の人の答えをみている **ところを** 先生に注意された。 

Again, what role do those particles play exactly and how do they influence the
sentence.

Thank you for your time.

