And if so, how did it manage to become the mainstream economic theory so quickly?
The thing about "Capitalism" is that before anyone sat dawn and put a label on it, it's more of a thing that just exists rather than something that was specifically invented or called into being. Besides, it also depends on which precise definition of Capitalism you are using (Marxian, Schumpeterian, or something else entirely). If Capitalism is the mere existence of private enterprise, then to find its "emergence" we have to look no further than the collapse of the Mycenaean "Palace Economy" and trace the seafaring routes of ancient merchants as early as the Bronze and Iron ages. If we are instead discussing a political and social system constructed by and for owners of capital (with that capital, in turn, operated by a wage-laborers) the system probably first emerged in Mediterranean Europe sometime in the 12th or 13th centuries (principally Italy — Incidentally my own area of interest) but was never the dominant social and political system at least until the 19th century. I can point you to this discussion I participated in a few years ago which might interest you.
In fact, "Capitalism" as a specific label for an economic and political phase of social development only really appears in Marxist analysis, specifically in Marx's theory of Historical Materialism. According to Marx, Capitalism refers to a point in time when the most politically influential class is that which owns Capital ("the Means of Production") which is operated by workers who receive wages. Marx contrasted this to Feudalism, which he defines as the phase which precedes capitalism where the most politically influential class was that which owns land, and the workers surrendered part of the fruits of their labor for the right to subsist off that land. You might imagine that there are some issues with this clean-cut analysis as presented by Marx, especially with assessments of Feudalism, as not only all sorts of more complex agreements could have existed between workers and landlords, but you also had communities in which land ownership was certainly not a prerequisite for political influence (this is the case with my own area of interest, Medieval Italy). As mentioned above, it's also true that private enterprise aligned with definitions of Capitalism existed long before the industrial age; it just wasn't the primary economic activity. Nowadays, even Marxist Historians don't really insist on the transition from Feudalism to Capitalism as described in Marx's Theory of Historical Materialism. That's not to say a class and power based analysis of material and political conditions as introduced by Marx isn't useful at all, but it does mean that it seldom paints a complete picture. You might be interested this discussion, this other discussion, and this podcast episode examining the use of Marxist historiography might interest you.
One of the things that are commonly conflated with "Capitalism" (which, as mentioned above, really only makes sense in Marxist analysis) is the "Liberal" political and economic philosophy which did have specific and vocal political and social proponents in the late 18th and early 19th century, and whose ideas were fairly novel at the time of their introduction. Liberal thought emerged in the earliest phase of the industrial revolution and offered social, philosophical, and economic justifications in favor of strong guarantees of personal freedom, guarantees of social freedoms (like freedom of speech and freedom of religion), and free transit of goods and services both inside and outside a given nation-state. The ideas of Liberalism are closely linked to the "Classical Economics," which is sometimes called "Classical Liberalism," espoused by the first economics thinkers like David Ricardo and Adam Smith.
Many classical liberal economists came from mercantile, commercial, or otherwise bourgeois backgrounds, and found themselves increasingly opposed to established policies favoring those whose wealth typically came from land ownership. While you'll recall from the paragraphs above that private enterprise wasn't exactly a new invention, the industrial revolution did see a rapid shift in economic activity away from agriculture and towards private enterprise (most famously industrial production, but also things like services and finance, which would grow more important over the decades and centuries). The Classical Liberal economists represented thinkers who commented on the first observable steps in this direction.
Did people treat the Classical Liberals' ideas on free trade and free enterprise with distrust? Not really; initial indifference which gave way to rapid acceptance would be a more accurate appraisal. David Ricardo, for example, as a member of the parliament of England was probably the most prominent liberal thinker in his lifetime (but not the most influential thinker overall) and while he was fairly well respected by his peers, ideas championed by him and other Liberals did not gain traction until nearly twenty years after his death (in fact, he was largely ignored in his lifetime; restrictions on agricultural imports were introduced in 1815). Associations in favor of free trade, such as the Anti-Corn Law League, started springing up in the late 1830s, and would gain enough influence to steer discourse, and eventually policy, about a decade later. By the 1860s, almost all major economies in the world had adopted laws in favor of free trade and private enterprise.
This answer is a bit dense and all-over-the place, and there's definitely more that can be said on the adoption of the Liberal Economic system all over the world in the second half of the 19th century (not all countries adopted it in the same way, or to the same degree) but it should go some ways to answering your questions.