When I think of music from the past, I think of church hymns, classical music like Mozart, Tchaikovsky, Chopin, Beethoven, Vivaldi and the like, Opera and national songs like Waltzing Matilda (Australian), Amazing Grace (American) or Катюша (Russian). The themes are typically religious, nationalistic, cultural or an attempt to capture some kind of concept (like Vivaldi's Four Seasons).
When I go through say the top 100 songs on YouTube or Spotify, few of them have anything in common with the music I know from the past. In particular, some common themes are the sexual exploits of the artist, the physical attributes of a potential partner or a commentary on the artist's feelings in a casual relationship (here I mean girlfriend/boyfriend as opposed to wife/husband).
This trend doesn't seem to be limited to North America (where I currently reside) either. I've noticed similar trends in Japan, Russia, Australia and much of Europe as well (listening to the music on their respective top music lists).
How did these themes become so prevalent? Is this new or have we simply lost similar music from the past?
To be clear, though I mention YouTube and Spotify, I acknowledge that the 20 year rule may exclude much of what we see today but I believe the question is still valid considering only history up until 1997.
EDIT: I'm not sure how my post got a "Balkans" flair, perhaps the mention of Russia?
Firstly, one of the oldest 'songs' we know of - the Song of Songs in the Old Testament - is clearly quite sexual. And pre-20th century Anglophone folk music did sometimes have sexual overtones, and did discuss non-husband/wife sexual relationships. But, clearly, there is a sea change in the portrayal of sexuality between, say, a traditional ballad like 'The Cuckoo', which clearly discusses infidelity - and, say, the 1993 track 'Ain't No Fun (If The Homies Can't Have None)' by Snoop Dogg, in which Snoop and his pals encourage casual partners to also share their sexual favours with his friends.
Musically, the character boasting of his sexual exploits fairly obviously goes back to the delta blues. Ted Gioia's book Delta Blues argues that the bluesman Muddy Waters was particularly influential on a lot of the particular kind of sexual braggadocio that started to suffuse rock music in the 1960s (and thus popular culture) - for instance, Waters' 1950 track 'Rollin' Stone' has Waters boasting about visiting a woman after her husband left, and talking about how his parents thought he was going to be a 'rollin' stone' (e.g., a wanderer, relationship wise). And 'Rollin' Stone' was the inspiration for the name of the rock band The Rolling Stones and the music magazine Rolling Stone, and probably influenced Bob Dylan's 'Like A Rolling Stone' too.
But of course Muddy Waters grew up in the Mississippi Delta, and 'Rollin' Stone' was a variation on 'Catfish Blues', a tune that had probably been floating around the Delta since the 1920s. 'Catfish Blues' wasn't particularly out of the ordinary in the 1920s-1930s Delta blues - the lyrics are a little more cryptic than in 'Rollin' Stone' but the likes of Robert Johnson certainly have lyrics like 'you can squeeze my lemon, til the juice runs down my leg' (in 'Traveling Riverside Blues').
Elsewhere in pop in the 1920s, there's not a whole lot of sexual braggadocio in 1920s Tin Pan Alley show tunes - there's a lot more sentimental love tunes - but there are sexual innuendo-laden songs in the Tin Pan Alley musicals of the likes of Cole Porter; Porter's 1928 'Let's Do It (Let's Fall In Love)' makes very clear, in the lyrics, that 'it' is something that the birds and bees do. Porter's 1934 'Anything Goes' refers to how 'the set that's smart is intruding in nudist parties in studios', contrasting this kind of thing with the Puritans who landed on Plymouth Rock (Porter jokes that, these days, Plymouth Rock would land on them).
The difference between the more strait-laced times of the past, and what had occurred by the 1920s is often ascribed, specifically, to the influence of the psychiatrist Sigmund Freud. However, in general, I'd argue that sexual morals had been loosening for some time, and Freud's success at the time was mostly a culmination of that.
The Industrial Revolution put large amounts of people into cities - those dens of iniquities! - and the effect of the Enlightenment was to slowly but systematically dismantle the influence of various Churches on peoples' behaviour, by recasting the state as secular, finding forms of philosophy and ethics which were non-religious based and making scientific findings that began to contradict the traditional Biblical explanations of the world. And in general, many well-known Enlightenment figures, who presumably tried to live their lives to Enlightenment values, lived lives less in keeping with traditional morality, often living openly and having children with people they weren't married to. After all, if you were living by non-Christian, secular ethics, Christian concepts about sexuality didn't apply.
Charles Darwin's 1859 On The Origin Of The Species argued that the main factors guiding the evolution of animals into their current states were the contest for survival and the contest to reproduce. In 1871, Darwin's The Descent Of Man explained in more detail the effect that the contest to reproduce had on the behaviour of various animals, including humans. Taking influence from Darwin (via a German populariser), Freud argued that sex and survival were the primary physiological motivators of human psychology, and books like his Introductory Lectures On Psychoanalysis are of course full of arguments that odd human behaviours in particular people go back to disguised sexual desires for others. Freud visited America in 1909 to enthusiastic reaction and was well known in American intellectual circles by the 1920s.
After the rise of secular values around sex in the 1920s in 'intellectual circles', it's probably safe to say they were introduced to mainstream pop culture en masse in the 1960s in the UK and US; the famous Philip Larkin poem 'Annus Mirabilis' discusses how 'Sexual intercourse began/ In nineteen sixty-three/ (which was rather late for me) -/ Between the end of the "Chatterley" ban/ And the Beatles' first LP." One of the drivers of this is the rise of 'youth culture', with the advent of a large demographic of 'baby boomers' who were born after World War II, who advertisers and purveyors of popular culture saw a market in. Youth, I suspect, has always been associated with sex, youthful hormones being as they are.
In a world with a female contraceptive pill, a further mainstreaming of Freudian ideas in the UK and US after World War II, and with a youthful market who were clearly intrigued by sexual music (Larkin's first Beatles LP, Please Please Me, had a title track after all where John Lennon fairly obviously was asking a sexual partner for fellatio after he'd been kind enough to perform cunnilingus on her). And in a world where Please Please Me is a hit, where youth culture is fascinated by sex, and where the dominant form of music, rock'n'roll, is a euphemism for sex in the first place, it's not a surprise that boundaries get pushed and pushed until you get, for example, Snoop Dogg's charming and sensitive (cough) ode to sharing his lady friends with his homies.
We do have records of sexual music in earlier times. But most of the music that was written down in the medieval era (which is when Western music was first notated) was for the church or the court. For church, it was obviously mostly sacred music (which doesn't always necessarily leave out sex). For the court, there was a culture of demure symbolism when referencing sex. Their culture had its own language of sexual jokes and symbols--which were written down, everywhere and in music. Music that was useful for notating institutions was recorded and reproduced, while other songs may have been sung in the streets but not written down. That does not mean they didn't have their own version of "picture this, we were both butt naked..." Just as most people who sing along to "my back, my neck" or "slob on my nob" wouldn't be able to notate music for the song, most popular oral tradition songs were not written down. In fact, we still are more concerned with notation in art music. if you want to perform one of the songs I just mentioned, you probably won't order sheet music for it--you'll just memorize it by ear.
Remember that just as we say "cock" and "pussy" -- animal names-- other eras had their own 'pet' names for genitalia, which often became the subjects of songs. And what's in that milkshake that brings all the boys to the yard? as for "bitches and hoes" -- female dogs and farm tools? People obviously like to be creative. the "nappy dugout" is not something you can look up in a dictionary. It's never been sexy to use clinical terms, and slang goes in and out of style fast. the meaning can be lost when centuries pass. In 100 years, will anyone know what "I did it all for the nookie" means? does anyone even know now?
Even in notated music, all the things you mention can be found in medieval and Renaissance music, as well as in music of every era. I can think of lots of examples of sex, and here are some to cover what you mentioned here:
the sexual exploits of the artist: Ich was ein chint so wolgetan, a medieval song about being raped from the (medieval) Carmina Burana, from the perspective of the raped girl (but possibly sung by a man at the time). That collection of songs actually has a lot of sexy ones: Chum Chum is calling to a pair of rose-red lips to "come make me better." It also has a rather serious but still sexy one about indulging pleasures of the flesh (Estuans interius) and in another song there's a line about how girls should have lovers, because "the girl without a lover misses out." There's also one about the desire to take someone's virginity. There's Il Grillo, a jokey song about having sex all night long ("grillo" was slang for penis, like cock or dick)--and this is from a Renaissance composer famous for his church music (josquin). Using the same concept is the "Lamento sopra la morte d'un grillo" -- lament on the death of a cricket by Banchieri, as part of a madrigal comedy about a guy too old to get it up but nonetheless lusting after his young neighbor. Die nachtegael int wilde tells the lover who comes to knock at the door: sorry, too late, someone's already here! a lot of french music and poetry, even really old stuff, uses death as a symbol for orgasm--to "die forever" is pretty sexy in songs like Lydia (Fauré) and Biauté qui toutes autres pere (Mauchaut).
the physical attributes of a potential partner: there are too many. they tend to focus on things like beautiful eyes, lips, and cheeks; fair skin. In a culture that dressed to cover up more than we do now, a speaker wouldn't have been able to remark on much more in a potential partner. I've seen "happy body," "radiant face," "noble form," skin white as a lily, lips red as a rose, flowers blooming, and more. Some argue that calling someone vaguely red or pink could refer to their genitals. Slang for body parts and orgasms can be found in a lot of old songs. These references are sexy, even raunchy by their own standards.
commentary on the artist's feelings in a casual relationship: the medieval song Je chevauchoie l'autrier describes a carefree woman who, although married, enjoys sleeping around. She tells the man she meets that she'd like to go enjoy herself with him. At the end she says that "in God's name" she'll get to have fun in the woods, and she encourages the ladies of Paris to leave their husbands and do the same. And there are a LOT of tragic songs about lost love after breakups, some of which specifically are not about husbands or wives. With courtly love songs, often language of desire is a poetic, subtle, symbolic code. "Lady, I sincerely wish that you acknowledge my desire" could mean a number of things--and it's intentionally blurring the lines. Lots of songs about non-marriage relationships have remained part of oral tradition. Early One Morning and Down By the Salley Gardens are two old folks song about losing one's girlfriend or boyfriend. There is a whole genre of song called the pastourelle that deals with a shepherdess or woman of lower class meeting a man of the upper classes, who then tries to seduce her.
I mostly gave medieval and Renaissance examples here (to go to the beginning of notated Western music) but there are many more examples! Just to go with one of the composers you listed, Mozart has an opera about women being abducted and forced into sexual slavery (it's a comedy...) and also one about a woman whose boss wants to exercise his right to sleep with her before she gets married. And there's always good ol' Leck mich im Arsch by Mozart: "lick my asshole."
There are tons of books about all of these things and more. I've also come across plenty of scholarly discussion on sexual symbolism in church and sacred music. There are scholars specializing in sexual symbolism and allegory of flower songs, bird songs, and animal songs.
TLDR: I can't tell you whether it's true, but I SUSPECT that Western classical music appears to have not been as explicit as today's music for two main reasons. 1) sometimes it was explicit, but we have a different vocabulary for explicit sexual talk today. 2) it developed from the inherited traditions and culture of medieval Europe, where church music and court music were notated (and other music was usually oral tradition, so records are harder to find)--and these two institutions did not usually specialize in sexually explicit music, even if (even though) that music existed.