We'll use California as an example. Texas, for instance, involves an attorney and every state has passed laws relating to this function which are a little different from one another. But we'll talk about enough so that what's generally happening should become clear. Broadly speaking, the title company was designed to be a neutral third party in the real estate transaction. They are not supposed to have a conflict of interest with the buyer, the seller, the lender, or any of the other parties interested in the outcome of the transaction.
Title holds the deposit that the buyer gives the seller, for example.
In a purchase transaction, the real estate agent usually opens escrow and in a refinance, the loan officer opens escrow. The loan officer calls up the title company and tells the escrow officer or administrative assistant that they'd like to open an escrow. The loan officer gets a unique number and the title company representative gets your name, address and possibly your social security number and current lender information. These latter two pieces of information are important, since if you are getting a new loan on your home, then the lender who currently holds the mortgage is going to be paid off. The title company has to know to whom they're sending this large check.