Adding to Jeromy's answer, the answer to your question would depend on what you want to study.
If you study normal behavior, common to all people, you assign your participants randomly to the experimental and control group. The experimental group receives the factor you want to study (e.g. watches some advertising), while the control group does not, and then you calculate the avarage difference in their behavior (do those that watched the advertising buy more of that product?).
If you study abnormal behavior, found only in certain people, these certain people (e.g. people suffering from some mental disorder) go into one group, people without this abnormality (e.g. people without that mental disorder) go into another group. Both receive the factor your want to study or are given the same task, and then you calculate the average difference in their behavior.
This, obviously, is not a random assignment. There are different techniques to counter biases (such as more old people with dementia in one group, because dementia usually happens in old age, so that performance differences might be attributable to age, not dementia). For example, you may "match" participants in relevant aspects, so that when you find a participant with, say, dementia, you search for a participant without dementia who has the same age, same sex, same educational background etc., so that their differences are unlikely to result from these secondary factors.
There are also experiments without control groups, or any kind of group assignments. For example, if you study something in which all (healthy) people are the same, you do not need a control group. For example, if you want to research human three dimensional vision, you could work with only one participant, because you could rightfully assume that all human beings have two eyes in approximately the same position, so that individual differences would not influence understanding the basic process. Many classic experiments in fundational fields of psycholoy such as perception were done with only one or a mere handful of participants.