The Introduction (page 7) of the 5e Player's Handbook states
That said, many racial traits, class features, spells, magic items, monster abilities, and other game elements break the general rules in some way, creating an exception to how the rest o f the game works. Remember this: If a specific rule contradicts a general rule, the specific rule wins.
It elaborates how most people don't have proficiency with longbows, but wood elves do, and that exception, being more specific, beats the general rule.
But what determines what is more specific? Is an Eldritch Invocation more specific than a feat? Does a spell (find familiar) override a class feature (Pact of the Chain), or the other way around? For that example, Pact of the Chain is clearly meant to expand the options available to casters of find familiar, but for potential contradictions where RAI is not as clear, which do we choose?