This is going to be a brick of text, I'm sorry and I could be wrong a bout this. But...
According to Adam Curtis, modern Yoga was and is heavily influenced from the start by western ideas and is the result of a series of cultural interactions between Britain (the west in general) and India in the late 19th, early 20th and then mid/late 20th century.
So fitness culture in the modern way we'd know it today, including bodybuilding, gymnastics, athletics etc began as "physical culture" and/or "muscular Christianity" in the late 19th century; because they thought that moral weakness or 'degeneracy' resulted from or was related to physical fitness, you could improve the moral character of people by improving their fitness (or something).
It was a vision of a restored physical and moral perfection in the young men who were going to run the empire. And it involved doing lots of exercises in new things called Gymnasiums. Then liberal reformers got worried about the working classes - convinced that the slums were leading to a "physical degeneracy" . So they persuaded lots more people to do exercises.
This was in-turn taking ideas from (idealized and sanitized for the time) ancient Greek culture, this is where the word gymnasium comes from and the celebration of physical perfection was a big deal (but was also a highly sexual thing in some parts). You can see it in the olympic movement aswell as they were kind of part of the same diverse and global culture (but later on).
The inventor (or populariser) of modern bodybuilding (and posessor of the most perfect male body)was a Pussian (I think what would be today east germany and/or west Poland) guy called Eugen Sandow, he said he was inspired by the Greek and roman statues etc and became a huge star globally with his bodybuilding movement that involved all kinds of spiritual stuff as well as gainz. After becoming popular in the UK, and the US, his magazine was a foremost part of a global culture of bodybuilding and physical fitness and this took him and his company to India.
In 1905 Sandow set up "The Empire and Muscle Competition", and then went off on a tour of the world. When he arrived in British India he became a sensation - thousands came to see him in his giant tent. He had arrived in India at a time of rising tension. There were growing protests against Britain's rule, and Sandow's gospel of strength now began to get mixed up with another ideology - Indian nationalism. In the next twenty years, as Britain's hold over India weakened, the culture of physical fitness that Sandow had brought to the country would re-emerge in a strange mutated form as a way of fighting against British rule. And in a further mutation this would lead to what we now know as modern Power Yoga.
This was inspired by a book by Mark Singleton called "Yoga Body" where he says basically that modern Yoga was influenced by older Yogic traditions also inspired by people like Sandow and Genivive Stebbins, who is a somewhat similar and parallel figure and one of the people responsible for modern gymnastics and dance, many of her exercises are similar to modern yoga poses. A (crappy) example of the difference I managed to find (from this review of 'yoga body' )
The older Hatha Yoga manuals such as Hatha Yoga Pradipika (dating from 14th century) define postures such as sirsasana (headstand) and padmasana (lotus) - but there is no mention of any sun salutations - nor in any of the other old texts.
There were obviously lots of professional Wrestling and fitness traditions like Yoga in india, but they were (usually) practiced by specific families of casts of people, not open to the public and often marginal and/or secluded in Indian societies. The way modern Yoga is as a public and national thing and the codifieng of different moves as well as taking new ones from western gymnastics and 'physical culture' and knitting them into an overall philosophy is part of this cultural blend.
Middle class Indian fitness movements and culture that eventually sprang up with figures who were inspired by Sandow and others were involved or related to the movement for Indian independence that was growing at the time. They were a way to compete with the British and build self esteem, nationalism and collective feeling, but also the fitness salons were meeting places for people involved. Something similar is true of Iran which also has a long history of bodybuilding and fitness salons.
From this summary.
[Singleton's surprising-and surely controversial-thesis I'm petty sure not controversial any more is that yoga as it is popularly practiced today owes a greater debt to modern Indian nationalism and, even more surprisingly, to the spiritual aspirations of European bodybuilding and early 20th-century women's gymnastic movements of Europe and America, than it does to any ancient Indian yoga tradition. This discovery enables Singleton to explain, as no one has done before, how the most prevalent forms of postural yoga, like Ashtanga, Bikram and "Hatha" yoga, came to be the hugely popular phenomena they are today.
After this it became popular in the mid/late 20th century in the west due to it's image as an authentically centuries old repository of eastern wisdom and method of getting in touch with x, y and z thing that we have lost, but there is basically no 'authentic' modern yoga, and like a lot of stuff, most of it isn't that old or that 'authentically' Indian.