As with most things it's pay-per-impression. If you're targeting across a wide geographic area, you can limit who it targets much more and still get a big number. Costs go up rapidly, though - I remember my wife ran a FB ad in Los Angeles where a 5-mile radius was gonna be a few hundred but a 10-mile radius was like $6k.
Just looking now, Facebook will let me put together a "campaign" where I basically get distance, gender and age. That's it. But if I want to "advertise my website" it gives me interests... and if I say "crypto" it allows
- Key (cryptography)
- RSA (Cryptosystem)
- Bouncy Castle (Cryptography)
- Cryptographic hash function
- Almas (cryptozoology)
- Cryptozoology (tv genre)
Now - I reckon you could target an ad to Bouncy Castle crypto pretty much worldwide and not pay a lot. Target an ad to cryptocurrency? A little more. Target an ad to "fans of Cracked?" Best have deep pockets.