I'm returning to Magic after a long hiatus, so my apologies if this question is obvious. I'm trying to understand why both of these rules exist:
506.4a: Once a creature has been declared as an attacking or blocking creature, spells or abilities that would have kept that creature from attacking or blocking don't remove the creature from combat.
509.3a: During the declare blockers step, if an attacking creature is removed from combat or a spell or ability causes it to stop being blocked by a blocking creature, the attacking creature is removed from all relevant damage assignment orders. The relative order among the remaining attacking creatures is unchanged.
Given what 506.4a says, when would 509.3a ever apply? Browsing other related questions suggests that when a card specifically uses the phrase "remove from combat", 506.4a doesn't apply (because cards overrule the rules), is that the only time you would fall back to 509.3a, or are there other examples too?
Edit for anyone reading this later who is still confused:
The accepted answer does give examples of cases when a creature is removed from combat, however murgatroid99 helpfully points out that 506.4a is much more precise than I initially thought - it only applies to cards that say something like "prevent this creature from attacking/blocking this turn", not literally any effect that could prevent a creature from attacking/blocking.