The intellectual climate in France in the middle of the twentieth century was dominated by the philosophy of structuralism. Structuralism has been applied to a diverse range of fields, from anthropology to philosophy to mathematics. Structuralism claims that meaning doesn't rest in the individual units of a given system (e.g. words in a linguistic system) but in the relationships between these units. We come to understand the world not by understanding the individual things that make it up, but by understanding the relationships between these things.
Structuralist thought influenced Foucault's early career. He developed an approach to intellectual history that he called the "archaeology of knowledge." This approach dismissed the importance of individual thinkers or motives, emphasizing instead the inescapable mind-sets that characterize different ages.
In his later career, during which he wrote The History of Sexuality, Foucault complemented this archaeological approach with a genealogical approach that he borrowed from Nietzsche. Nietzsche argues that the concepts we use are rarely fixed, but that they evolve to suit the changing needs of different ages. Nietzsche shows how our concepts of "good" and "evil" have changed over time. In The History of Sexuality, Foucault makes the same argument about our concept of "sexuality." By arguing that our concepts and self-image are fluid and contingent on quirks of history, Foucault adopts a position that has been termed "post-structuralist."
To a large extent, The History of Sexuality attempts to refute what Foucault calls the "repressive hypothesis": the claim that sex has been consistently repressed, and that we can only achieve political liberation by means of sexual liberation.
The History of Sexuality is also considered a foundational text for the relatively new field of queer theory. Queer theory studies the intersection between politics, gender, and sexuality. Its main thrust is to refute the idea our identities are somehow fixed or determined by our gender or sexual preference.