If we look to "science" today, we can see that it relies heavily on funding. In fact, so much so that "science" can't move without it in some instances. So where we have markets and capitalism, we can see that the thrust of science is driven by such; some "science" is crafted, other "science" is utterly ignored or starved. So even in a superficial way, we can begin to take note as to how our perception of what "science" is has a contextual element from within the society it is birthed from.
Foucault's primary gist, if you can survive reading his work in English, is that the very ontologies are fundamentally flexible and yield to the ideological underpinnings of a given time. One must historicize to see "science" clearly, and indeed he does just this in the work. Others have written since then, including discussions of the recent creation of "science" as we know it today, which isn't nearly as ancient as some would have others believe[1].
It can be an incredibly difficult tome to wade through, but one that comes with significant reward if you manage to parse the work.
[1] https://dangerology.wordpress.com/2013/09/13/steven-pinker-i...
Foucault of course is much more expansive than my trivial example, covering the notion of institutions as ideological enforcement, among other things.
No fool on Hacker News can summarize his work in a reply, and one would be heavily encouraged to read it. It cuts right to the core of epistemology itself.
In hindsight, I truly believe that not only were his theories several generations ahead of their time, but also likely a critical body of work regarding epistemology that would relate to developments in AI etc.