How Does Google Know ‘Apple’ is a Company and Not a Fruit?

Have you ever wondered How Google Knows that ‘Apple’ is a Company and Not a Fruit? Or how your phone’s keyboard predicts the next word so…