To be honest, you're way off. When you're arrested or at the arraignment some of the basic information that you have to provide is your name, social security number, etc.
With your SSN, they can easily obtain your DL number. It's easy for the courts to find out, where you're living, what kind of cars/toys you have registered, etc. They can even obtain your state income tax return.
That gives the courts a fairly good idea about your means to hire an attorney for a pending legal case.
As for a Public Defender, that's the last person you want representing you in court. These attorneys are usually to dumb to work for the state or county prosecuting criminal cases and they get paid very little.
The lawyers that you would pay for know the judges and other lawyers way better because most started out working for the state or county prosecuting these cases.