Note pachinko parlours are also gambling dens (albeit using a loophole so that legally they aren't). Japans laws are about as stringent as they are over here, although they're not implemented at all effectively, allowing this pastime to blossom.
Basically you pay for little ball bearings, which you can feed into the machines. There's a tiny bit of skill in playing those machines, but it's mainly pure luck whether you'll end up with more balls or less. You can take those balls back to the counter for a voucher I think it goes, then you can leave the establishment, and more often than not go in a different door that's actually part of the same building, and exchange that voucher for a prize. I'm not sure you can turn that back into money there, but when the prizes include stuff like gold jewellery, it's pretty easy to sell that for a profit if you were luck in the parlour.