They take place in fake settings. By creating an artificial environment to conduct the experiments, they can then find a cause-and-effect relationship between two factors. This involves a control group and an experimental group, the two groups are treated in different ways, and the results are compared.
The logic of it is that the sociologist manipulates variables in which they are interested, in order to discover the effect, they have. Identifying a cause-and-effect relationship, it allows us to make predictions about society and patterns of behaviour.