How does the brain learn what something is for the first time? I'm trying to understand how the idea of what a thing is originates in humans.

For example, in computer science, it is possible to know what an object is and what it does, by examining its "parent/ancestor" objects with concepts of inheritance:


  In object-oriented programming (OOP), inheritance is a way to reuse
  code of existing objects, or to establish a subtype from an existing
  object


and polymorphism, where objects may share similar function:


  Subtype polymorphism, often referred to as simply polymorphism in the
  context of object-oriented programming, is the ability to create a
  variable, a function, or an object that has more than one form. In
  principle, polymorphism can arise in other computing contexts and
  shares important similarities with the concept of degeneracy in
  biology


What makes me interested in this is that human children do not learn all words at once - there's a slow, but steady exposure to new stimuli, which are quantified, remembered and become available as concepts and words. The exact order of exposure is unknown, but if I remember correctly, most people know about 20000 words, and use about 6000 in daily interactions. 

For example, a child has never seen a potato. A child sees a potato for the first time.  A child has neither an idea nor a word for a potato. Now the child's brain has to create an idea of what a potato is.

The question: When a child is exposed to a new stimuli, as in the example above, does the child's brain:


create a brand new representation of an object
or does a person's brain modify and re-purpose the "closest matching"
idea and add extra attributes to it? (a potato looks like a brown rock)


In other words, has there been any research that found evidence for case 2: a "common ancestor" for ideas and objects within a person's mind? (if a person forgets "rock", then the person also forgets "potato").

I don't know where to begin a search for the answer. Are there some keywords that I can use? Maybe scholarly articles on cases of unusually high working memory capacity for related objects?
According to current models of human concept learning, the answer to your question is both. 

Think of a simplified domain in which every object consists of only several features, and therefore can be visualized as a point in some multidimensional feature space. For example, the features that define objects might be its size, shape, color, and weight. Furthermore imagine that objects tend to be clustered throughout this space according to what category they belong to, because members of the same category are generated by the same natural process. 

So based on current models, a novel stimulus is compared to existing concepts and is either placed into the concept (cluster) that it's closest to, or if it's insufficiently close to any existing concept, then a new concept will be created. This is the basic idea of current Bayesian theories such as the Rational Model, which treats human category learning as a problem of probability density estimation, and its contenders such as  SUSTAIN. 

Here's a video lecture by Josh Tenenbaum, a leading researcher in both machine learning and cognitive science, in which he gives an excellent introduction to a number of these issues and many more.