The information is pulled from the quote object that is persisted in the database. The integer on the end of the checkout/cart/configure/id/123 is a reference to the quote item ID from the sales_flat_quote_item table.
In short, when you hit the configure page, it fetches the item and looks up the configuration option selections in order to pre-populate the form with them.
You could access this information via...
/* @var $cart Mage_Checkout_Model_Cart */
$cart = Mage::helper( 'checkout/cart' )->getCart();
/* @var $item Mage_Sales_Model_Quote_Item */
$item = $cart->getQuote()->getItemById( $id );
There's a method available to
getBuyRequest that returns the configured options.
* Returns formatted buy request - object, holding request received from
* product view page with keys and options for configured product
* @return Varien_Object
public function getBuyRequest()
$option = $this->getOptionByCode('info_buyRequest');
$buyRequest = new Varien_Object($option ? unserialize($option->getValue()) : null);
// Overwrite standard buy request qty, because item qty could have changed since adding to quote
->setQty($this->getQty() * 1);
This is a good starting spot.