How does artificial intelligence work?