I'm wondering why they can pay for clicks from affiliate links, does it have a system to track clicks from visitors? how did it work?
I'm not fully sure what you mean - but assuming you want to know how to track clicks on affiliate links. The way you do that is simple. The process goes like this:
Masked Link -> Capture Click Data -> Redirects to Affiliate Link
The masked link is what is displayed. You could use the following:
1) URL shortner like bitly, tinyurl as they capture link click data
2) Affiliate Link Plugins - typically these will capture link click data before referring the user onto the affiliate URL
3) Self hosted solution i.e. YOURLS which is similar to URL shortners. This too captures the link click data before redirecting user to the affiliate link.
Hope that helps!