My department hired someone less qualified than me for a job I applied for because they fit better with the culture.
More people experience this than they realize.
You got passed over for a less qualified person who simply fit in better.
If this sounds familiar, the Library can help you find the bigger picture.