This is easy
What you have here is a low voltage (NEC Class 2) transformer that steps house voltage down to a safe voltage -- they're typically used to power doorbells or HVAC controls, but may be found in other places as well.
Simply get your new cable into the box with the power off (use one of the built-in NM clamps you can see on the bottom right), then connect black to blacks, white to whites (+a black from the transformer), and bare to bares/greens. While you're at it, use a grounding screw and pigtail to attach the box to the bare/green ground wire bundle.
Then you can install the new receptacle and its box on the other end of the new cable.
It is a transformer. It purpose is to reduce your house voltage to something lower, typically used for doorbells.