Generally, you go to the courthouse and obtain a marriage license. You have to present proof at that time that you've fulfilled the requirements for that state's marriage. (Example: Michigan requires an STD test.) After that, you have a certain amount of time (varies by state. I think I had a week in Michigan, but can't remember. I got it the day before the wedding) for the marriage to be "solemnized", at which point it is official. Whoever was the official, such as clergy or judge (we had a caterer. She also had some sort of religious title, but she was not a rabbi, but basically she had filed some paperwork with the state to say that she would do weddings, and she wanted to know if we wanted just the ceremony, or also the catering package) signs on the dotted line and mails in the proper paperwork to the records office.
Traditionally, the religious aspects matter, but today anyone can do weddings as long as they register with the state, and get the paperwork right.