In the words of Peter Stanfield, "working cowboys did not yodel, unless they were Tyrolean immigrants, aspiring blackface minstrels, or intent upon mimicking Jimmie Rodger's records."
Although yodeling's traditional use is pastoral, in 19th century Europe, music incorporating folk song styles was immensely popular. Professional composers and musicians used yodeling and yodeling melodies to evoke Alpine society specifically or more generally to evoke a simpler, rustic lifestyle close to nature.
Through the mid-nineteenth century, this background of popular music in Europe as well as German, Swiss, and Austrian immigrants to the United States and traveling "Tyrolese" yodeling minstrels influenced American minstrel shows. These traveling shows showcased traditional European folk songs including "Tyrolean" yodeling numbers as novel attractions frequently with attractive "fräuleins". Performances by minstrel artists like Tom Christian of the Christy Minstrels & Sanford's Minstrels transformed yodeling numbers or "Tyrolean warbling" as they were parodied, built into comedic acts, and combined into other musical styles like ballads.
As black minstrels and blackface (with its inherent stereotypes) became popular in minstrel shows, yodeling was appropriated and mixed with work songs, spirituals, and "coon" songs; adapted using a single falsetto tone (versus the intermixing of normal and falsetto tones in traditional yodeling); and influenced by Ragtime rhythms. With certain singers, changes to traditional yodeling highlight stereotypes of African American speech patterns. Emmett Miller is one example of a minstrel/vaudeville artist of this period who later recorded his music for Okeh in the 1920s. Several black performers including Winston Holmes and Charles Anderson recorded and had success with yodeling records in the vaudeville style in the 1920s.
By the turn of the century, music composers and publishers and the fledgeling recording industry reflected the popularity of yodeling including the comic German stereotypes and ragtime influences built in minstrel shows. Many of the yodeling melodies and songs from this period reappear in later periods. Actor, singer, composer J K Emmet(t) is one example who helps establish "Dutch" comedic stereotypes and has his yodeling melodies reappear in hillbilly and cowboy music.
So how does yodeling move from European folk music to popular music to American minstrel shows to cowboys? Southern rural musicians playing hillbilly music, which was influenced by the large Scottish and Irish immigrant communites and which featured falsetto shifts similar to yodeling, also watched, enjoyed, and incorporated yodeling from traveling minstrel shows into their own repotoires. Riley Puckett recorded one of the first hillbilly songs including yodeling in 1924, and Jimmie Rodgers, aided by his lack of regional twang, popularized yodeling adding it to almost all of his recordings and including blues music. His "blue yodels" were widely imitated, and the market for hillbilly music exploded. During 1929 alone, hillbilly and rural records accounted for 25% of 65 million record sales. During this period, the lyrics of songs including yodeling fully shift from pastoral, romantic, bucolic ballads to rough and raw mountain and travel songs with occasional asides into lullabies and nostalgia.
It is also during this period that the cowboy, with its mythicization continued from dime novels and Wild West shows, is given voice in radio and eventually in movies. Yodeling with its plaintive blues tones, association with rugged and raw lyrics, and hillbilly instrumentation fit perfectly with the imagery of cowboys. In fact, artists like Jimmie Rodgers embraced the "cowboy" stereotype in part to escape the negative connotations of hillbilly hick artists. Singing cowboys or cowgirls including Gene Autry, Roy Rogers, Patsy Montana, and Carolina Cotton, often developing in the southern rural tradition of yodeling, are featured on radio and movies. Artists like the Sons of Pioneers feature three-part harmony yodeling but also focus on western-themed music and lyrics. Female yodelers in particular found popularity in the cowgirl persona that was not avaible otherwise as female artists
Throughout the 1930s and 1940s, cowboy-themed yodeling develops as distinct from the hillbilly yodeling (and blues and minstrel and European popular music and European folk song and actual pastoral communication). They tend to be more up-tempo with major key tonality (in contrast to the blues); they also feed into extant cowboy stereotypes with bravado virtuoso and romantic crooning. Interestingly they also contain more allusions to the mountains of Europe and re-establish a connection with herding. However, in spite of its popularity, yodeling still maintains a connotation of folk and rural music.
Into the 1950s and 1960s, the idea of the singing cowboy and yodeling with its connection to the mountains and rural areas lose popularity although it is still maintained to some extent in country and bluegrass music at times divorced of the kitsch and comedic element that are residuals of the minstrel show period.
Sources:
Horse Opera: The Strange History of the 1930s Singing Cowboy by Peter Stanfield
Yodel-Ay-Ee-Oooo: The Secret History of Yodeling Around the World by Bart Plantenga
Behind the Burnt Cork Mask: Early Blackface Minstrelsy and Antebellum by William John Mahar
Deans and Truants: Race and Realism in African American Literature by Gene Andrew Jarrett
Country by Richard Carlin
TL;DR: Yodeling in the Alps > folk music > European popular music > American minstrel shows > hillbilly music > cowboy and cowgirl radio and movies