Prejudice is, as the name implies, the process of "pre-judging" something. In general, it implies coming to a judgment on the subject before learning where the preponderance of the evidence actually lies. Sometimes this is a matter of fallaciously extending one’s own experience to the general case.
In other cases, it may be a matter of early education; those taught that certain attitudes are the "correct" ones may form opinions without weighing the evidence on both sides of a given question. When applied to social groups, prejudice generally refers to existing biases toward the members of such groups, often based on social stereotypes.
For example, a person who has had a series of bad relationships with those of the opposite sex may develop a prejudice against that sex, and thus assume that the factors souring the relationships are always present in members of that sex, and adopt the set of prejudices known as sexism. Or, if a person has grown up with the concept that members of group "X" have certain characteristics, they may apply this prejudice by assuming that all members of the group fit that stereotype, as in racism, linguicism or homophobia.
It has to be stressed that prejudice is simply the formation of a judgment without direct or actual experience, not merely holding a politically unpopular view. Prejudiced views are often necessary at times for human survival as we don’t always have time to form a personal view on a potential foe before adopting a defensive stance which could save our lives. To these ends a prejudicial or instinctive view on a person or situation is useful and aids survival.
This must be differentiated from viewpoints accumulated though direct life experience. These are definitively not prejudiced, conditioned or necessarily instinctive. They are not pre-judgments but post-judgments.
Another interesting intellectual conundrum is to consider whether deeply held spiritual or religious views are also prejudiced since they are commonly not based on direct experience. Confusion is often found in common speech between terms for personal views held in the light of experience and the legal term for a judgment having been passed. In law, the phrase "With Prejudice" implies a judgment having been made after the presentation of evidence. The term does not imply any form of bias.