Why is ANOVA not p-hacking? Say we have some data with many parameters. As an example let's say I'm an not-so-ethical journalist working for a food website and I'm looking to write some clickbait article "backed by science" about how some food or lifestyle is good/bad for you.
My data might contain a set of thousands of people, their socioeconomic status, what they had for breakfast, whether they're vegetarian, whether they prefer tea or coffee, etc. and also what their scores are for an IQ test.
If I split the dataset into many (100+) groups, where group one might split vegetarians/meat eaters, group two might split coffee drinkers and tea drinkers, group 3 might split female coffee drinkers and male tea drinkers etc. If then use ANOVA to compare all groups to see if there's a statistically significant difference, is this not effectively p-hacking?
I understand that ANOVA won't tell us which groups are different, but it seems like it would be a quick way to confirm that there IS a (false) positive in there. And then it's a case of finding out which groups are different.

You appear to perhaps be confusing p hacking with application of statistical methods involving more than a single binary explanatory variable (also see below, where I address post hoc tests following ANOVA). This reminds me of the accusation "Anyone can lie with statistics!" which, while true, does not reveal some special truth about statistics: when describing human communication you can just expostulate "Anyone can lie" full stop.
Regardless of statistical method (e.g., ANOVA, or something else), the term p hacking connotes a researcher (or research group) who has prioritized reporting "statistically significant findings" over reporting "scientifically substantive findings" (whether positive or negative)… if not outright abandoning the reporting of findings of scientific substance. So p hacking is less about a specific statistical method (ANOVA or otherwise), than it is an orientation towards what one does with the method (and the study design, measurement, selection of participants, level of inference, etc.).
A good cue, if you are unsure whether you are p hacking, is whether your research is lead by a well-formed theory-driven question in your particular domain of research, one that it would be valuable to answer, (with choice of research methods, including statistical methods following the lead of that question), or whether you start with a specific statistical method and go looking for "questions" to answer.
Finally, ANOVA (and other omnibus hypothesis tests) do just what they say on the package: identify whether there is enough deviation from similarity among all the groups collectively for a given type I error rate (i.e. $\alpha$). Of course, p hacking really comes into play with the post hoc pairwise tests—if there are $k$ groups, then there are as many as $\frac{k^2 - k}{2}$ of these, which gives a good chance (specifically an $\alpha$ chance) of false positives to be reported as "statistically significant". Non-p hacking researchers can account for this by using muliple comparisons adjustment strategies (e.g., false discovery rate, family-wise error rate, etc.).
Randall Munroe's "Significant" is always worth a chuckle, and is germane, so I am including yet again here. :)

