Of course, if there exists some exigency allowing them to force entry, they might just do so.
At least in an apartment complex they might have the ability to get a key from the manager rather than smash in the door. Amazing how we will knock and knock, ring doorbells, and knock again. And when we enter with the key the occupant(s) inside are amazingly "asleep" or "were in the shower" and did not hear us.
There is never a legal requirement to answer the door. But, sometimes they do not need your consent and can enter anyway - even without a warrant.