The difference is the time period during which a person might commit new sins that need to be forgiven. The shorter the period the better. A person on their deathbed has fewer opportunities to commit sins.
Also, the form of absolution near death is different. The priest can’t expect someone on the verge of death to say a bunch of Hail Marys, let alone any bigger acts of atonement.