How does search engine marketing (SEM) function in internet marketing?