How do chatbots work?

Chatbots are designed to emulate a human support agent by either using scripted answers or NLP. The chat can occur via text or voice.