Just like it's necessary to be logged in to have a persistent cart. Things are keyed by customer id.