Well, like actual gambling, it all comes down to luck. Of course, the slots in Pokemon are in fact easier than their real world counterparts, to state the obvious. There's really no technique or know-how for spamming the slot machine to cough out all of its coins, it's just timing and luck.
If you want to do the math: there are 6 chances of getting good coinage consisting of three "7"s (300 coins), "R"s (100 coins) , Pikachu (15 coins), Psyduck (15 coins), Magnimite (10 coins), and Shelder (10 coins). This is further laid out over 3 vertical, 3 horizontal , and 2 diagonal rows, or 8 chances all together to get those chances. Don't forget about the chances of getting a berry in at least a row, which will give you either 2 or 6 coins, depending on where it's at.
Those, my friend, are your chances of getting coinage from the slot machines.
Bulbapedia's slots page
Serebii's slots page