Can someone explain how does the Roms execute?
Simple version - the microprocessor (a Z-80 in this case) reads the program code, graphics, etc. from the ROMs; runs the program code; and outputs the display and sound.
Pac and Ms Pac used the same board/layout, so you can convert one to the other by changing a few ROMs and adding/removing the Ms Pac daughterboard.
With Jr Pac and Ms Pac, you're dealing with different PCBs laid out in different patterns with different chips and different size ROMs with different numbers of pins. There is no way to convert between these with a simple ROM swap.
Ms Pac board (click for full-size)
.JPG)
Jr Pac board (click for full-size)

If you look along the along the top edge of the boards you'll see numbers (column) and along the left edge of the boards you'll see letters. (row)
The names of many MAME ROMs use the column/row to identify the location of the chip that holds that data.
- IIRC some may use a schematic designation like "U7" that is silk-screened on the PCB
or some other means to identify a particular chip's location/function/data.
For example:
The first Jr Pac ROM listed at the
solvalou link that meyer980 posted earlier is "jrp8d.bin" ==> column 8, row D ==> the ROM chip with the bright white label just right of center, third from the bottom.
The graphics ROMs are "jrp2c.bin" (2C) and "jrp2e.bin" (2E) ==> the two in the lower left with labels.
The sound ROMs are "jrprom.7p" (7P) and "jrprom.5s" (5S) ==> top center-left without labels.
Scott
P.S. You can barely read the markings to confirm, but the 40-pin Z-80 microprocessor is at 8B.