There could be lots of reasons why you don't get hired (or get the promotion/raise), but I found a good list of items from Mike Walsh on his blog: 6 Reasons I Won't Hire You. I like the list, and for the most part I agree with what Mike has written.
The first few items are important. You should be able to tell people you don't know. I might suggest that you actually document some of these items in your blog or resume/profile and talk about them. Show people that you didn't know something, you could admit it, and you could find out or learn it yourself.
I'd also caution people to be aware that not all jobs are for you. It can be hard when you are desperate for a job to not fit the profile, or get an offer, or something else. If you ask for feedback and they say you weren't a good fit, that can be very depressing or disconcerting.
However it's okay. One of the things a job interview is supposed to do is determine if you're a good fit for this position. Not that you can do the job or have the skills, but do you fit in this environment, with this team of people, with these clients. Sometimes you just don't fit, and it might not be your skills. It might be your personality or approach doesn't fit the system.
These are a few reasons you might not get hired, some of which you can change and some you can't. Change what you can, accept what you cannot.