This is known as A. the group dynamic.
The group dynamic means that we exhibit one type of behavior when we are within a group of people, which may or may not be completely different from what we behave like when we are on our own. The reasons for this are various, but we mostly want the members of that group to like and accept us, which is why we try to conform to their behavior.