Machine learning is definitely a big part of it, but you can also get surprisingly far with simple bag-of-words models when applied to enough data.