It may come as a surprise to you (which only shows how little it has
been written about this) but most of the ‘important’ things in
SharePoint are actually done through unmanaged code and the SharePoint
.NET object model provided by the Microsoft.SharePoint.dll is a sort
of a wrapper to this unmanaged world. Understanding how your code does
what you want it to do can be very helpful when troubleshooting
issues, fixing bugs, doing performance tuning and writing solid code
in general so I believe that every SharePoint developer should know
about SPRequest.
As you are aware the gateway to doing anything in SharePoint is the
SPSite object. In order to get to any other objects that reside in a
site collection such as SPWeb, SPList, SPListItem, SPFile and others
we first need to obtain an SPSite and there is a very good reason for
that. Every SPSite instance holds a reference to the unmanaged WSS
world in the means of a field member of type SPRequest which is called
m_Request. The internal SPRequest class has an unmanaged reference to
a COM object called SP.SPRequest and having a ClassID of
BDEADEE2-C265-11D0-BCED-00A0C90AB50F which is implemented in and
exposed by the OWSSVR.DLL class library.
The SP.SPRequest COM object exposes almost 400 basic operations and
almost everything you do with the Microsoft.NET managed SharePoint
object model that reads from or writes to the ContentDatabase
(including data, fields, content types, list schemas, etc) will
actually go via this unmanaged COM object.
For more info read Hristo Pavlo's post