It isn't even the rubber in the neoprene that keeps you warm -- it's the gas bubbles trapped in it. The useful nature of neoprene is that it traps bubbles in an insoluble and impermeable substrate, so that you can immerse the stuff without the gas being displaced by water. The thicker the neoprene, the more insulating capacity it has.
The ideal wetsuit admits as little water as possible, just enough to fill the air spaces, as described. It then minimizes the exchange of that water with the water in which you are diving, so that you expend only the heat you have to to warm that first bit, and don't continue to lose heat to water that then is lost to the ocean.
A perfect neoprene wetsuit is a neoprene dry suit (
), but then you do need to add a little air to avoid squeeze. Neoprene dry suits are very warm in shallow water.