The promotion applies to each individual purchase.
Separate purchases are eligible each for the Beats promotion.
So if you buy an eligible Mac you get a set of beats.
If you buy an eligible iPad on a separate transaction you get another set of Beats.
Once per eligible device though:
From: https://www.apple.com/promo/pdf/EN_US_BTS_070518.pdf
For Eligible Mac purchases, only one (1) Promotion Product per Qualified Purchaser may be obtained during this promotion. For Eligible iPad purchases, only one (1) Promotion Product per Qualified Purchaser may be obtained during this promotion.
A second Mac or iPad purchase would not be eligible.