The effect of dispel magic varies depending on what you target.
There are 3 things you could conceivably dispel dispel.
- The casters body
- A possessed target
- the soul container
The caster
If you dispel the caster and succeed the spell ends, the container is destroyed and the casters soul attempts to return to their body.
A possessed target
If you dispel a possessed target then the casters soul is ejected and returns to the container if it is able.
The container
It is unclear if the container is a valid target for dispel magic and what the magical effect on it is. It may function as a possessed object or as a creation of the spell itself.
Is the magical effect its ability to hold souls?
Since the jar is destroyed when the spell ends it seems the jar is transformed into a new magical object by the spell (a soul container). If this is the case then when dispelled the container would lose its ability to hold souls and be functionally destroyed. Ending the spell, possibly without the container physically being destroyed because the effect that would have destroyed it was dispelled.
If this was meant to have been the case the spell really should have said that it created a magical soul container. Making it unambiguous that the container was a magical effect and could be dispelled, destroying it. Instead it is just hinted to be the case.
Is the magical effect the specific soul inside it?
Another option is that the jar itself is non magical and that the magical effect is the specific soul in the jar. In if the jar or the soul is dispelled then which ever soul is in there returns to their body. If it is the casters the spell ends, if it is a victims then they return to their body and the casters soul returns to the container if it is able.