Why machine learning instead of simple sorting and grouping?

I have a hard time formulating this question(I’m not knowledgeable enough I think), so I’ll give an example first and then the question: You have a table of data, let’s say the occupancy of a building during the course of the day; each row has columns like “people_inside_currently”, “apartment_id”, “hour_of_day”, “month”, “year”, “name_of_day”(monday-sunday), “amount_of_kids”, “average_income”…

Details