The neocortex is a mammalian invention, not present in birds, reptiles, or any other vertebrates. It's associated with the increases in intelligence seen in mammals since the end of the Cretaceous, especially in primates, and more especially in humans. While there are dozens (probably hundreds) of discussions of the neocortex available on the Web, I haven't been able to find one that meets my needs (for linking to in detailed discussions), so I'm going to produce my own, in the process discussing a recent paper which reflects on it.
The neocortex develops from a part of the developing neural tube called the telencephalic pallium. This is the part of the telencephalon that is towards the back (dorsal) and upper side (dorso-lateral), while the part towards the middle of the body (medial) develops into the hippocampus, including the dentate gyrus and some other parts of the brain associated with memory (especially spacial memory) and navigation. The bottom (ventral) part of the telencephalon develops into the basal nuclei, which "are associated with a variety of functions: motor control, cognition, emotions, and learning. [Wiki]" (The telencephalon is split into two parts, one on each side, a feature not visible in Figure 1.)
Figure 1: Parts of the neural tube. (From Wiki)
We'll come back to the neural tube, but for the moment let's take a look at the structure of the neocortex, by comparison with other structures: ... those that develop from the medial and ventro-lateral part of the pallium, and those in reptiles such as turtles and lizards (crocodilians are too closely related to dinosaurs and birds, and will not be considered) that have been shown to be almost certainly homologous to the neocortex: the dorsal and dorso-lateral cortex. These latter structures develop from the same part of the pallium in these reptiles as the neocortex does in mammals, and they share many similar connections, so it's worthwhile drawing parallels.
Most sites discussing the neocortex will tell you that it has six layers rather than the three found in these other structures, and that the cells mature from the outside in rather than the opposite. Many will also tell you that incoming axons arrive from the bottom rather than the top: that is from the direction of the inside of the neural tube rather than the outside. All these facts are generally true, although some details are often left out and the language is often obscured by the use of various anatomical terms. Let's go over it in detail.
The first difference has to do with the direction of maturity, the fact that cells mature from the outside in. Neurons in this part of the neural tube are created by cell divisions in the very inner part of the neural tube, called the ventricular zone. From there, they migrate radially, towards the outer part of the tube (called the pial surface). In turtles and lizards, these cells begin by settling in the outer part of what will become the dorsal cortex, and later cells settle inwards of them, closer to the center of the nerual tube. This is what is meant by outside-in maturation, since once they settle, these cells begin to mature.
What most sites discussing the neocortex don't mention is that in the mammalian hippocampus (except for the dentate gyrus) the first cells settle on the inside, closest to the middle of the neural tube, and later cells settle farther out. This is exactly what they do in the developing neocortex, which means that this change is not limited to the neocortex, but is somewhat more general to the mammalian pallium. It's a good guess that it came first, and it allows for a greater thickness of cortex with interconnections, even without the other changes, as is shown by the structure of the hippocampus.
The next change is the six-layered structure, which arises in the upper dorsal pallium and the dorsal part of the lateral pallium. This structure probably derives from the more primitive three-layered structure found in turtles, lizards, and the mammalian hippocampus, although the latter has evolved a much thicker outer layer and a characteristic "double-C pattern" with the dentate gyrus curved around the hippocampal gyrus. The three-layered structure in general is called the "allocortex": this word specifically stands for the parts of the "cerebral cortex" with a three-layered structure, although it's often used for other areas with the same cortical structure. (The "cerebral cortex" technically refers to the entire cortical area formed from the pallium, but is often instead mistakenly identified with the neocortex.)
We need to start by describing the three-layered structure, then, before we can compare it with the six-layered. The three layers are like a sandwich, with areas of mostly neurites (axons, dendrites, synapses, and glial cells) making up the bread, while the filling is densely filled with neural cell bodies (somas). Most of the neural connections come from the outside (the side away from the center of the primitive neural tube), while in this area most of the axons leaving do so out the bottom (the side towards the center of the neural tube). This provides for a simple "pass-through" system, in which the nerve cells process the incoming information and produce an output which goes to another brain region.
The disadvantage of this system is that the incoming axons are growing along the top of this layer, and trying to make synaptic connections with any cells they encounter. Since most of these cells don't want any specific connection, most of these attempts are refused, which constitutes a major waste of resources. Which leads us to the third difference, which is that many incoming axons from other parts of the brain come from below in mammals, in more evolved mammals, such as primates and carnivores, virtually all. We'll discuss this shortly.
Before we do so, we need to consider the layers of the neocortex, which are very different from the allocortex. The layers of the neocortex are usually numbered I through VI (usually using Roman numerals, although many websites use Arabic). Layer I is almost completely free of neuron somas, being mostly made up of neuropil, along with blood vessels and other support structures. Layers II and III have many neuron somas, a good mix of pyramidal cells (see below) and interneurons, the latter usually making local connections with their axons as well as their dendrites. Layer IV is composed of a mix of stellate cells, which like interneurons make local connections, in the sense that they typically don't extend their axons out of the area they reside, but they extend much farther than interneurons, and they tend to be exitory rather than inhibitory (see below). Layers V and VI contain mostly pyramidal cells, although with some interneurons, and the lower part of layer VI often contains a large proportion of neurites, especially axon branches.
In the allocortex, the majority of the interconnections are in the upper layer, although the lower layer (the one closest to the middle of the neural tube) has lateral extensions of outgoing axons, which make some connections, probably rising into or through the middle layer. In the neocortex, the bottom layer, called layer VI, roughly corresponds to this layer, consisting mostly of lateral branches of outgoing axons, which then make connections with other neurons (or glial cells). The middle layer of the allocortex has often been compared to layers V and the upper part of layer VI of the neocortex, because the cells (with somas) there usually extend their axons to other parts of the brain, as do most of those in the allocortex.
Very few cells of the allocortex (at least in turtles and lizards) make connections to other areas of the allocortex; they mostly talk to other regions of the brain. Thus, areas II and III of the neocortex, most of whose pyramidal cells send their axons to other parts of the neocortex, can reliably be considered new in mammals. That leaves areas I and IV, either of which might be compared to the outer layer of the allocortex, although there are differences in both cases. Axons coming from other regions of the brain usually terminate in layer IV of the neocortex, especially those coming from below, which would make this area comparable to the outer layer of the allocortex. Axons coming from other areas of the neocortex usually terminate in layer I, which would suggest that it's new. However, axons that crawl along the outside of the neocortex, most of which come from lower parts of the brain, probably interact with layer I in the same way that similar axons in the allocortex interact with its outer layer, which would imply some comparability there as well. It's well to remember that these comparisons are merely tools, artifacts of our need to use analogy to understand what's going on. Evolution is hardly constrained to fit within the categories we make for our convenience.
Before we consider the various connections into and out of the neocortex, let's take a look at the early evolution of the neural tube. This structure is inherited by vertebrates from their chordate ancestors, indeed recent research shows that the chordates themselves almost certainly inherited it from the earlier common ancestor of the echinoderms, hemichordates, and chordates. I have already suggested that concentration of nerves into a cord was primarily dependent on the availability of a circulatory system that could deliver enough oxygen to power their energy-dependent activity, a development that could have ramped up via the cold temperatures of the "snowball earth" conditions long before the Cambrian.
In chordates and their ancestors this oxygen was essential both to the neuropil, the system of nerve somas, neurites, and glial cells that performed calculations, and the axons which carried the results to other locations within the neuropil. However, in vertebrates we find Myelin, which insulates the axons and both increases the speed of impulses by perhaps an order of magnitude (or even more, depending on its thickness), and substantially reduces the energy requirements. This means that the primary requirement for energy was to the neuropil, the "grey matter", while the mass of axons, the "white matter" required much less.
In the original neural tube the neuropil was on the inside, while the axons were on the outside. This structure is almost certainly primitive, since it's carried over into the retina, where the reversed structure of the neural tube is expressed, and the nerves carrying information from light-sensitive cells actually travel over the surface of those cells (gathering and passing behind the retinal surface in the "blind spot"). In the spinal cord, it was developed into the standard structure of gray matter on the inside and white on the outside, which is very expandable, since most of the axons are traveling in a forward/backward (anterior/posterior) direction, and they are simply pushed farther apart (rather than lengthened) by expansion. Similarly, an expansion of the gray matter simply thickens it, with little impact.
In the front of the neural tube, things became a little more complex. Most of the primitive spinal cord was originally dedicated to controlling the actions of a body that was basically eel-like, swimming with an undulating movement, perhaps modifying it's motion with movements of the "fin-flaps" along each side of its body. Even when the "fin-flaps" came to be replaced with dedicated fins at the front and back, this just caused a small specialization of pre-existing bundles of ganglia, without impacting the effectiveness of the basic structure.
Figure 2: Five vesicle stage of embryo. (From DEVELOPMENT OF THE CENTRAL NERVOUS SYSTEM
But from the beginning, the brain was different. As you can see from figure 2, the di-encephalon has a pair of extrusions, which actually develop into the retinas. The olfactory system, OTOH, develops from the very front of the telencephalon. This puts the rest of the telencephalon between the optical system and the olfactory system. What does that mean?
For the earliest vertebrates (or chordates), swimming involved an undulatory movement that caused both the eyes and the nostrils to weave through the water. In order to identify whatever objects were seen in the water, their path in the visual system had to be integrated with the knowledge of the body's movement (coming from parts of the brain further back) to provide their location relative to the animal's actual path through the water. With chemicals diffusing through the water, the situation was more complex. Each object was emitting various chemicals that the olfactory system could sense, which diffused away from it subject to local currents and variations, until after a certain time it impacted the path of the nostrils (usually located at the very front of the animal) as they wove through the water. Thus the integration of olfactory cues with observed objects was a very complex problem.
In an earlier discussion I mentioned that even the earliest "swimming sponges" would have found a highly beneficial (speaking selectively) use for integrative intelligence, and the same holds true here. We can't estimate the intelligence of these animals, or this part of their brain, by the number of axons going into or coming out of it, because it might not take many axons to carry the information needed for the calculation, relative to the complexity of the calculation itself. But this would have made the region of the brain that later became the neocortex essential to the survival and prosperity of these animals, and when the necessary number of neurons and connecting axons grew, evolution provided the answer with the changes we observe in mammals.
If we fast-forward to the development of the earliest mammals, we find animals that used the three-layered allocortex for this process. At this time, the areas of the dorsal pallium primarily received input from other regions of the brain, especially those that would become the thalamus, and sent their output to other layers, also often (other parts of) the thalamus. Presumably, this part of the brain performed calculations that were, in effect, straight transformations: integrating and massaging incoming information to provide answer(s) that could be sent on for further use.
I've mentioned that in the allocortex inputs primarily arrived at the outer layer. Cells in the middle (and lower) layer had to make connections to them, which they did by extending a large dendrite, called the "apical dendrite", to the surface. What makes them pyramidal in shape (which gives them their name) is that they also extend smaller dendrites in other, lateral, directions, to receive inputs from other cells in their own layer. This tends to control the shape of the cell, which looks like a pyramid because each of these large dendrites tends to create a "corner" on the cell. The axon, with its axon hillock, tends to be much smaller, and doesn't really affect the shape of the cell. Pyramidal cells are the primary type of cell that send axons out of cortical area to other parts of the brain.
The other primary type of cell in these cell-rich layers are interneurons, which are usually inhibitory cells: unlike pyramidal cells (and stellate cells) they use a neurotransmitter (GABA) that tends to cause the target nerve cell not to fire action potentials rather than making it fire as excitatory cells do. Interneurons tend to have smaller arbors for both their dendrites and axons, although they often enough couple together via electrical (gap) junctions so that a single action potential can spread over quite a distance. They also usually migrate tangentially from other parts of the developing brain.
In mammals, as well as in dinosaurs and birds, the need for more complete integration of the various calculations, as well as more sophisticated time-dependent analysis, resulted in many further connections between various areas of the future neocortex. In the ancestors of dinosaurs, this led to the evolution of the wulst, a structure that has sometimes been compared to the neocortex, but has convincingly been shown to have developed independently.  In mammals, the neocortex evolved.
The early interconnections between cortical regions, in reptilian ancestors, went via the thalamus. However, to create a new intercortical connection via the thalamus it's necessary to create a new population of thalamic nerve cells, as well as processes to guide axons from these new cells to the target area of the cortex. Of course, a new population of pyramidal cells in the cortex is also necessary, which will sample the calculations going on in the neuropil and send the output via their axons to the appropriate spot. It's also necessary for guidance processes to evolve so that those axons can find their way to where their output is needed. But if the connection is directly cortical-to-cortical, these are all that are needed: nothing involving the thalamus is required.
The development of new cell types, with their new connections, depends critically on the six-layered structure of the neocortex. In this regard, I want to mention a recent paper, Cerebral cortex development: From progenitors patterning to neocortical size during evolution (by Alessandra Pierani and Marion Wassef), which unfortunately is behind a paywall. This paper surveys current knowledge of how pyramidal cell formation is regulated during the development of the neocortex. A key point is the specification of different subtypes destined for different layers:
The distinct laminar subtypes of neocortical neurons are born in a tightly regulated 'inside-out' sequence. The neurons destined to the deep layers are produced first followed by neurons fated to populate successively more superficial layers. Lineage tracing of single radial glia progenitors indicated that, at early stages, radial glia progenitors can produce successively the full repertoire of the major layer-specific neuronal types both in vivo and in vitro. Transplantation and cell culture experiments have, however, shown that the repertoire of the radial glia progenitors becomes progressively restricted ([refs]). The group of McConnell has shown that early cortical progenitors at the stage when they normally form layer VI neurons are multipotent and can generate later-born neurons of upper layer II/III, if exposed through transplantation to signals from a late cortical environment ([ref]). In contrast, later progenitors at the stage when they normally give rise to layer II/III neurons fail to produce deep layer neuronal types when transplanted to an early environment ([refs]).This means that a complex interaction of transcription factors, and feedback loops among them, progressively tightens the ability of these progenitor cells to differentiate, limiting them to the current stage and later stages.
There have been some exceptions discovered to this pattern in rodents, which might complicate things, they are still under investigation.
There are also tight structures of transcription factors and loops among them that regulate the proliferation of early progenitor cells, controlling the ultimate area of each part of the neocortex. Pierani and Wassef also discuss the means by which the various parts of the neural tube are sectioned into regions such as the neocortex, and how the areas within it come to be defined. Gradients of various signalling molecules are built up, so the the ratio of these different molecules at any point is unique, after which a system of cross-repression divides the developing neural tube into specific regions, with gradients of signaling molecules within these regions which presumably allow incoming neurons to find their way to their specific target spot within the region involved.
Precisely how the new layers of the cortex, layers II and III, first arose can only be guessed at (at this point). It seems likely that the inside-out progression, and the tightly regulated system of distinct laminar subtypes described by Pierani and Wassef, evolved first, laying the groundwork for layers II and III. Once these layers were present, a new cell population could arise via mutation that targeted another cortical region, a far more likely (or less unlikely) event than depending on a thalamic relay. We can envision that the progressive evolution of the mammalian neocortex proceeded from this point.
We can see, then, that the neocortex, with its more sophisticated structure, allowed a substantial increase in the interconnectivity of the various regions of calculating neuropil, which in turn permitted the massive expansion of the brains, and intelligence, of the evolving mammals.
Alessandra Pierani, & Marion Wassef (2009). Cerebral cortex development: From progenitors patterning to neocortical size during evolution Development, Growth and Differentiation, 51 (3), 325-342 DOI: 10.1111/j.1440-169X.2009.01095.x
Links: (I've included only the link called out in this leader.) Not all of these are called out in the text, and too many are behind a paywall. Use the back key if you came via a footnote.
1. The evolution of the neocortex in mammals: how is phenotypic diversity generated? paywall
2. Genetic and epigenetic contributions to the cortical phenotype in mammals
3. Similarity and Diversity in Visual Cortex: Is There a Unifying Theory of Cortical Computation?
4. Do birds possess homologues of mammalian primary visual, somatosensory and motor cortices? paywall
5. The contribution of spike threshold to the dichotomy of cortical simple and complex cells paywall
6. Laminar processing in the visual cortical column
7. Neuronal circuits of the neocortex
8. The early differentiation of the neocortex: a hypothesis on neocortical evolution
9. Cortical mechanisms of action selection: the affordance competition hypothesis
10. Area Patterning of the Mammalian Cortex
11. Hagfish embryology with reference to the evolution of the neural crest paywall
12. Cyclostome embryology and early evolutionary history of vertebrates
13. Migratory neural crest-like cells form body pigmentation in a urochordate embryo paywall?
14. Brain and Behavior (IPHY 3730), University of Colorado at Boulder not peer-reviewed, but a good overview
15. Brain segmentation and forebrain development in amniotes paywall
16. Vertebrate head development: Segmentation, novelties, and homology paywall
17. Thoughts on the development, structure and evolution of the mammalian and avian telencephalic pallium
18. The emergence and evolution of mammalian neocortex paywall
19. The functions of the preplate in development and evolution of the neocortex and hippocampus paywall
20. Cortical Excitatory Neurons and Glia, But Not GABAergic Neurons, Are Produced in the Emx1-Expressing Lineage
21. Postnatal development of the telencephalon of the tammar wallaby (Macropus eugenii). An accessible model of neocortical differentiation paywall
22. Development of the olfactory system in a wallaby (Macropus eugenii) paywall
23. The Medial Pallium
24. Centralization of the Deuterostome Nervous System Predates Chordates paywall
25. Cerebral cortex development: From progenitors patterning to neocortical size during evolution paywall