Coming from the base meaning of the noun
中（なか） meaning 'inside', the addition of the case marking particle
を in its role of identifying the place where an action is taking place creates a grammar structure that can be translated as 'doing (B) in (A)', 'doing (B) on (A)', or 'doing (B) inside of (A)'.
With this grammar point, (B) will be the action, while (A) will be a noun indicating the location.
I always tell you to empty out the lunch box first thing when you come home, don't I?
When I was wandering around the supermarket without buying anything, the security guard thought I was suspicious so he came to talk to me.
Caution - The person or thing that is doing the action that 中（なか）を
is indicating may not actually be within the noun being marked with (A). A good example of this is 'doing (B) into (A)', such as with the う-Verb 覗（のぞ）く 'to peer'.
I thought, 'My kid is suspiciously quiet', so I peeked into their room, but they were just sleeping.