It's a matter of focus and context. If the focus is on a specific row in the portal, expressions that refer to fields via the portal's table occurrence will refer to the fields of that portal row's record. If the focus is on the layout, the same reference will access data from the first related record--which will likely be the first record in your portal.
There are better ways to add/edit records in a related table. You might web search on MagicKey to learn more.