In psychology, the concept of conformity is defined as fitting in with a group. People can change their behavior, attitude, beliefs, opinions, and values to align them with the general behavior and opinion of a group. Conformity, therefore, is a type of social influence.
The two main types of conformity are normative and informational conformity.
Normative conformity is when an individual changes their behavior to fit the norms of the group in the hopes of not being seen as an "outsider." In other words, the individual conforms to the group's norms in order to be accepted and liked. Peer pressure and following fashion trends are examples of normative conformity.
Informational conformity is driven by informational influences, in which the individual conforms to the group when they're convinced that the group's opinion is accurate. In this case, the person conforms because they look for information and knowledge from the group because they believe that they might be wrong and wish to be correct and right.
There are also three additional types of conformity: identification (a person shares the beliefs of the group because they like the group's opinion or they identify with the group), compliance (a person publicly agrees but privately disagrees with the group), and internalization (a person changes their opinion because they accept and agree with the opinion of the group, both privately and publicly).
In 1935, Turkish American social psychologist Muzafer Sherif, commonly referred to as the father of modern social psychology, conducted an experiment on conformity known as the Autokinetic Effect Experiment, in which he theorized and concluded that a person is willing to give an incorrect answer if that answer matches the answer of the group, which means the person is ready to conform if the group convinces them that the group's opinion is the right one.
In the 1950s, Polish American psychologist Solomon Asch conducted a series of experiments known as the Asch paradigm to determine how a person's behavior and opinions are influenced by the group, or to determine how social pressure from the group can make a person conform. He theorized and concluded that when the majority of the group consisting of fake participants gave a certain response, one individual, who was the actual real participant, felt enough pressure to conform to the group's general norm, opinion and/or behavior, regardless of the individual's personal stance.
You can learn more about the various theories of conformity here.