How does adware work?

Can you answer this question?