Access to Omnipotence
Clerics, druids, and paladins get their spells by communing with a being which is generally ancient and/or powerful enough to have Seen It All. Since these kinds of casters prepare their spells each day as part of this prayer or meditation, they have immediate access to all spells their deity or primordial patron knows of the highest level they can currently cast and lower, though the grantor of the spells may have preferences for certain spells (e.g. cleric domain spells).
Since rangers and warlocks gain their spells through very similar connections, it makes no sense to restrict them to certain spells known. Instead, they meditate or pray each long rest to prepare spells the same way a paladin does: choose a number of spells equal to half their class level (rounded down) plus their key ability modifier and Intelligence modifier, if any. Therefore, a third-level fey-pact warlock with a key ability modifier of +3 and an Intelligence modifier of +1 would be able to prepare up to 5 spells per day from the combined primal and warlock spell lists; however the DM may rule some spells off-limits to a warlock based on their pact source, such as a fiendish patron who forbids spells from the divination school or a celestial patron who forbids spells from the school of necromancy.
Warlocks who have Intelligence as their key ability do not get double their modifier in spells prepared per day, but instead get one additional spell prepared at their present level. A fifth-level fiend-pact warlock who casts with Intelligence and has an ability modifier of +3 would be able to prepare 6 spells per day from the combined arcane and warlock spell lists, subject to any limitations imposed by the patron.
Added to House Rules in 2023; modified 18 Feb 2024 to clarify prepared spell limits for warlocks with INT as their key ability.