Web hosting affiliate programs are designed to allow a hosting company to promote their business at a much lower cost than traditional advertising programs. For example you join a hosting affiliate program from a large hosting provider such as GoDaddy, Hostgator, Bluehost, etc. They offer to pay you a set amount per action taken by visitors that come from your unique affiliate id that they assign to your account. When a visitor clicks on the banner or link you place on your website and buys a service from them you will get a predetermined amount based on the service that they purchased. There is normally a waiting period for the money to become available to you which is normally based on the money back guarantee of the company that you are promoting. Some web hosts pay several hundred dollars per new client for their premium services of course this is more the exception than the norm as the average payout is much lower.
Building a successful affiliate marketing business is a lot of work and takes time. You can go to sites such as Commission Junction, Shareasale and Impact and join as a member. From there you would create your profile and tell advertisers about you and your website. Once set up you would apply to the programs you want to offer. Most of these programs manually approve new websites and look for established sites with minimum traffic requirements and website quality. Most will not approve websites automatically because they do not want their links on spam sites designed for nothing more than clicks. The quality of the traffic received is extremely important to advertisers.
If you plan on building a site around affiliate advertisements I would highly recommend you create a site that consistently adds quality content and promote it on relevant websites to help grow your traffic. Remember you want to be a quality partner for them this will make you and them more money by thinking of it this way.