According to Background and Key Concepts of Piaget’s Theory written by Kendra Cherry

According to Background and Key Concepts of Piaget’s Theory written by Kendra Cherry, Piaget believed there were some factors that influence how children learn and grow. Schemas are both the mental and physical actions involved in understanding and knowing. Schemas are categories of knowledge that help us to interpret and understand the world. In Piaget’s view, a schema includes both a category of knowledge and the process of obtaining that knowledge. As experiences happen, this new information is used to modify, add to, or change previously existing schemas. Assimilation is the process of taking in new information into our already existing schemas. The process is somewhat subjective because we tend to modify experiences and information slightly to fit in with our preexisting beliefs. Accommodation involves changing or altering our existing schemas in light of new information. Accommodation involves modifying existing schemas, or ideas, as a result of new information or new experiences. New schemas may also be developed during this process.
One-way to explain how the notion of schemas be related to stereotyping is to use Piaget’s theory that we organize information in our mind by unconsciously creating categories. The reason for this is we encounter information regularly and the primary functions of schemas is to allow us to make generalizations about people, places and things. Making these generalizations makes it easier to understand and make sense of new information we process.