First of all, if you don't get the job you applied for, it is always worth asking for feedback as to why your application was unsuccessful. You may or may not get a response, but you lose nothing by making the request, and may get some useful insights.
I get more requests from candidates who were not shortlisted, asking to know why they weren't, than I do from those who were interviewed, wondering why they weren't hired. Of course, the former category of candidates vastly outnumber the latter, but I'm surprised that so few of the latter do get back to me. I suppose that if you've been interviewed and didn't get the job you tend to have a good idea why not, and also once you've had that face to face interaction with the potential employer it is more difficult to confront them with a request to justify their decision not to hire you (certainly both of these factors have affected me in my own past unsuccessful applications). It's still worth asking though.
I must say that from the other side of the table, the most frequent reason for rejecting a candidate who has been shortlisted is simply that someone else interviewed better on the day. When I first started interviewing job applicants it was in my capacity as one of the governors of the Linen Hall Library in Belfast, and under Northern Ireland's fair employment legislation we had to be pretty systematic: the interviewing panel agreed five questions to ask, rated each candidate's response to each question, added up the scores we had given them at the end and had to submit a detailed written justification if recommending anyone other than the candidate who got top marks. It gave me, I hope, good habits which I like to think I have stuck to since.
"Another candidate interviewed better on the day" isn't especially helpful feedback, I admit. Usually you can construct a further justification based on skills and experience - and the ability to talk about them in the interview - but the personality factor ("can I really bear to share the workplace with this person?") is important too, and also intangible. Occasionally one gets a severely negative vibe - "this person is clearly a psychopath, do not hire them" - in which case I pray that they won't ask for feedback. More often the problem is choosing between two or more enthusiastic and personable candidates, and the justfication can be difficult, but I think it's good for employers to be asked for that justification from time to time.
It's usually much easier to explain why candidates didn't make the shortlist. I tend to delegate that decision, but am always happy to deal with requests for feedback (and have never felt that the person screening CV's for me made the wrong call). Sometimes it is simply that the skills and experience are just not what I am looking for. (To which some enthusiastic but unskilled candidates protest, "but I am willing to learn on the job!" To which I reply, "I have another 20 candidates here who would not have to learn on the job!")
Even more often, though, it is simply that the covering letter and CV do not pass the 20 second test of engaging the interest of the person scanning a hundred job applications to boil them down to a shortlist of five or ten. These are actually much the easiest to give feedback on, and the biggest piece of advice is usually the same: emphasise the bits of your career which make this job application look like an obvious next step (and if there are no such bits of your career, maybe that should give you pause for thought).
There are other points of detail which do crop up fairly often. If your university dissertation was relevant, give some details. If you're a graduate, don't bore me with details of your high school career (unless they are actually relevant). Don't make stupid mistakes in listing your hobbies. Above all, don't lie.
Of course, I'm writing here about applications for jobs which have been advertised and go through a shortlisting and interviewing process, and I have to admit that it is more than thirteen years and three or four jobs ago since I last successfully did this from the other side. (Two of my last four job changes involved me persuading a new employer to hire me for a position that was envisaged but had not been advertised; I have also moved to a different position with the same employer, and been recruited out of the blue for a position that I had seen advertised but hadn't actually applied for.) But a lot of this also applies when you are trying to get a job through other mechanisms. In particular asking for feedback on an unsuccessful application does no harm and, particularly perhaps if it's not a standard shortlist/interview/decision process, can help to give you closure.