In college, I was a gender-psychology major. I spent a good amount of time studying the questions you asked, both theoretically and empirically. Now I will attempt to answer your question.
To me and many other folks, the ideal way of choosing a person to marry is to see whether the personalities match, the future house income, living habits, each person's social network, and common Yes's and No's, etc. In reality, it rarely works like this.
The vasy majority of marriages are done by the following four steps:
1. The first contact
2. The chemistry
3. The fulfilling of needs
4. The rejection of alternatives
So two people meet (Step 1). This can be anywhere. A bar, the office, church, party. Then they think each other looks pretty good (Step 2). Hanging out with each other satisfies their needs (Step 3). The need doesn't have to be sexual but for many couples it's a big one. The need can be money, a car, the notion of a trophy gf/bf, someone to talk to, or (as in case of medical student) the right to say "I'm not single." Then they stop seeking for alternative dates, because 1) to maintain fidelity 2) their needs are fulfilled (Step 4). Many of such relationships end, but a good portion proceed to marriage.
IMO, the #1 determinant of a relationship is proximity. There's also a good amount of experimental evidence in the psychology literature to support this claim. You are 1000x more like to marry a person sitting in your classroom than a girl who lives in another town but can be a 1000x better wife.