I have heard in certain political circles that prior to the British invasion of India and the establishment of colonial rule, the Indian textile industry was producing higher quality textiles at lower costs than the British textiles being produced in Great Britain.
Thus, one of the motivating factors for British imperialism to be extended to India was to take control of their crops, shift their industry to more agricultural based production of things such as spices, and generate revenue via trade while eliminating competition for British textiles.
How much truth is there to the claim that the Indian textile industry outperformed the British textile industry in terms of quality and cost and would this have been significant enough to warrant an invasion?
Depending on how you define 'outperforming'. If you mean by volume of finished product imported into Britain and mainland Europe or even by the quality of the product and finally the price of the product in relation to its quality....yes, India was significantly outperforming Britain and other textile producers till ~1790's.
According to Sven Beckert in his 'Empire of Cotton', India significantly out produced Britain while churning out higher quality textiles for a lower price. Wadsworth and Julia Mann in their 'The Cotton Trade and Industrial Lancashire, 1600-1780' state that the arrival of Indian cotton into England in the late 1600's significantly altered the dynamics of the domestic textile market / industry. It essentially forced British producers to either react by copying designs and prints or later, as they couldn't compete with the flood of cheaper, higher quality Indian textiles, resorted to lobbying for protection which resulted in the Calico Acts. The Calico acts in a nutshell banned the import of cotton (mostly Indian, but Chinese and Persian as well) and substituted cotton with local wool products.
Not just Britain, but India till about 1750 was the dominant supplier to global markets. The Gujarati ports exported to the Red Sea ports and the middle east. The Punjab production went overland to Afghanistan and central Asia. With the arrival of the Dutch East India company and British EIC, they acted as aggregators and thrived on the re-export market. In the case of the British EIC, it even had a statutory monopoly (cause for the first Mughal Anglo war).
All that said, the numbers can be quite telling,
Indian Exports of cotton pieces to the British markets started out with a low ~130,000 pieces a year in ~1660 and rapidly reached a million pieces by ~1680. By 1690 when the Calico acts (and similar protectionist measures were taken by France and the Dutch as well) were in place, the Indian exports dropped to ~200,000 pieces. Once the acts were slowly lifted or eased, the exports once again rise to ~800,000 pieces a year by 1740.
Now we get to the interesting part, from 1770 to ~1790 barring the odd dip, Indian exports via the British EIC reached on average ~ 850,000 pieces a year but starting ~1795 the exports plummet to ~ 3,000-4,000 pieces a year. A precipitous fall of some 99% in a span of 5 years.
Now what might explain this...drastic fall from an Indian perspective? In 1757, after the Battle of Plassey, the British EIC took direct control of the production and supply of Bengal cotton and by 1800, the British conquest of India was total.
At the same time, the industrial revolution was in full swing and important technical inventions such as the Crompton's Mule, Power assisted Mule etc etc were radically changing the productivity and standard quality output of the British Textile industry.
The answer though is not as simple as it may seem because India also went through rapid social churn following the decline of the Mughal Empire. The internecine wars amongst the successor states impacted agricultural productivity, driving up food costs and thereby causing a spike in the nominal wage costs of Indian labour (source - Rethinking Wages and Competitiveness in the Eighteenth Century- Britain and South India by P Parthasarathi)
I am sorry that my answer might be confusing, but there were a multitude of factors at play, we cannot for sure say that x lead to y, however what is irrefutable objectively is the role protectionism, tariffs and the eventual conquest of India by the EIC played in the absolute decline in the Indian textile industry (export of finished products).
To the second part of your question, no, the British did not 'liberate' India for its textiles. Actually the British expansion in India was not a planned affair, the EIC fought a series of local wars against local kingdoms and the three main empires (Sikh, Maratha and Mysore), but there was never any systematic or overarching policy at play.
I could expand on this more if you wish, you could also read the spectacular work by Jon Wilson, 'India Conquered'.
As referred earlier, if you are interested in an exhaustive work on the cotton / textile trade, please do read Sven Beckert's Empire of Cotton.
Happy to answer follow up questions if any.