Man, I wish I could answer this in a sentence. And a thousand words from now so will you.
In the dawn of time writers just wrote. Publishers just published. Sometimes the stories would have an element of myth, or the supernatural, or terror, or scientific romance. It all got lumped together. There were fiction magazines but no specialty category magazines or publishing lines.
In the early 20th century publishers discovered that readers specialized, and that they did not like paying for 20 stories in a magazine when they read only four. The specialty pulp magazine was born. By the mid 20th century, there were science fiction magazines and fantasy magazines (and terror magazines, which we would call horror and which I’m going to ignore). Most of the time these tried to maintain the lines but some magazines ran both and some writers wrote both and some readers read both but enough readers who were huge fans of one hated the other so much that it was worth making the distinction commercially. In 1949 the Magazine of Fantasy started but changed its name with the second issue to the Magazine of Fantasy and Science Fiction, because they published a true mix and science fiction was more commercial a name. It stayed an anomaly, but the field was called SF or F&SF interchangeably.
In the 1950s SF finally became a book publishing category. Fantasy was a tiny outlier. SF was, in the cliche, about spaceships. The field was overwhelmingly male in every part from publishers to editors to writers to readers. There were always some females, but nobody guesses higher than 10%.
That began to change in the 1960s, after the paperback reprints of Tolkien took off spectacularly. Publishers began lines of faux-Tolkien, almost all written by men at first. Eventually they saw the readership of these fantasy lines skewed female and many more females started writing it. The Science Fiction Writers of America (SFWA) changed its name to the Science Fiction and Fantasy Writers of America (still SFWA: don’t ask). The overall field, however, was still called either SF or F&SF and everybody understood it internally. SF was for men and Fantasy was for women, although both now had minorities of maybe 30% and certain writers had huge crossover appeal.
In the last decade, as romance took over the publishing world, a category called paranormal romance - romance with elements of F&SF - began to grow. It now may be larger than science fiction and fantasy combined. It is overwhelmingly female in authorship and readership. The writers join the Romance Writers of America and SFWA mostly ignores the whole thing. Is it F&SF? Um, probably, depending on who you talk to and the context.
Wait. It gets worse. Children’s books and their offshoot, YA books, have always been an entirely separate publishing and marketing category. The very tony publisher Farrar Strauss Giroux wouldn’t dream of publishing an adult science fiction work until the 1980s even though it made a mint off of Madeleine L’Engle’s A Wrinkle in Time in 1962. All the super-mega-bestsellers of today are YA F&SF - Harry Potter, Twilight, Hunger Games, and many more. Their numbers are so huge that they dwarf all the adult fields combined. And their readership skews female, and gets more so with every female-oriented blockbuster.
Can I make it worse? Sure can. There are other marketing categories that may overlap. Technothrillers. Alternate History. Steampunk. Action-adventure. Tie-in books (all those novelizations of Star Wars and Star Trek and novels about superheroes and bunches more). And horror, which had its day in the mega category but has faded almost as far as westerns. All of these probably skew male, except for some of the tie-ins. Probably. Nobody seems to play too close attention.
So what is science fiction? Which of these categories and definitions do you use? It depends, it depends, it depends. Outside the industry, SF is still about spaceships. Inside, it’s a giant muddle of everything you can think of and more. Magic realism, anyone?