1. the pointer to the object
2. the pointer to a reference counter
when the shared_ptr gets an non null object or another shared_ptr is assigned the reference count is increase by one
when the shared_ptr looses the object or is destroyed the reference count is decreased by one
if the reference count is 0 (no one uses the pointer to the object anymore) the object (if not null) is deleted.
this way you don't need to worry about the lifetime of the associated object