The basic answer to this is that both the French Revolution and the Industrial Revolution changed society in dramatic ways. As society changed, some scholars came to think about how societies in general change and how they can be stabilized and/or held together. Out of these thoughts came the discipline of sociology.
Before the French Revolution, European societies had remained at least relatively stable for a long time. They had been characterized by a high degree of hierarchy and inequality. With the French Revolution, this changed (particularly, of course, in France). All of a sudden, people were cheering as their monarchs were executed. Different forms of government were rising and falling. There was upheaval as had not been seen in a long time. In this environment, people like Auguste Comte started to think about society and how it functioned. They wanted to improve society and make it more stable. In order to do this, they had to first understand how societies worked.
The Industrial Revolution had a similar impact on society. Before the Industrial Revolution, European economic life had remained rather stable for a very long time. People tended to work in or near their own homes. They tended to work as family units and had a great degree of control over how and when they worked. They also tended to live and work in roughly the same places and the same ways that their ancestors had. With the Industrial Revolution, this changed. Now, people were leaving the countryside and moving to new and growing cities. This created a society that was much more urbanized than ever before. Now, people were no longer working at home or with their families but rather in factories away from home. People who worked in factories, of course, were in no way able to control when or how they worked. All of these things meant that society was changing in very fundamental ways.
As with the French Revolution, this made people like Comte, Herbert Spencer, Karl Marx, and (somewhat later) Emile Durkheim think about how society worked. It made them want to understand society’s workings more clearly so they could help to improve (as they saw it) society. This was the beginning of the study of sociology as a formal discipline.