Explain how an affiliate program works as both an advertising program and a revenue generation program; give two real-world affiliate program examples.