Something I've always wondered:
As a recent hire, is it okay for me to ask why I was chosen above the other candidates?
You can, but you probably shouldn't.
People might not want to discuss this and you might not want to know the answer.
Answers that you might not want to hear include:
I would not ask this on the first day on the job. Just accept that you have the job, and focus your energy on getting up-to-speed in your new job. After a few months, after getting to know your colleagues, you could approach someone in the group of people involved in hiring you, and ask them what the considerations where for hiring you and not someone else.
"There are ways of getting people to talk". Sometimes, however, what you learn may not be something you want to know.
The presumption is that you are the most qualified for the job. If your boss has some kind of prejudice, however, you may find out you were hired on a different axis of consideration. These may not be 'the usual suspects' of race and gender. If, for example, a C-Level executive had to fire 3 MBA teams in a row (s)he may avoid hiring a fourth team of MBAs. If the last three people your boss hired were fresh out of the military and they're all still there, (s)he might conclude this is a safe bet.
The questions to ask aren't 'why did you hire me instead of (x)?'. Is your programming team all wearing blue jeans and sneakers with holes in them? Would a 'suit' be compatible in this group? Does your boss avoid certain areas of town because (s)he 'doesn't feel safe' there? Some organizations pay lip service to longevity, others really care, and try to figure out if they can't pay enough to keep more qualified applicants happy.
I worked for one company where the previous person in my role would only work after everyone else went home. About a week after I started in this job, my boss told me we already had more computers than we needed. In short, I figured out right away he considered the IT people to be a power center in competition with his. This would explain the inclination of the previous employee to stay out of the way, and at some point the atmosphere deteriorated and I moved on.