Where is the actual money represented in an e-wallet stored?

Lately, I’ve been interested in digital wallets (e-wallets) and how they work in a deeper level. For the most part, I understand some of the core components that are needed to create an ideal e-wallet. But the thing that I haven’t confidently figured out is where does the actual money for the e-wallet go?

Say I was to create a hypothetical e-wallet , which uses stack coins (sc) such that 1 sc = $ 10, and a user sends $ 40 to the hypothetical e-wallet. The user the should have 4 sc.

So to the developers end, where is the $ 40 directed, should the developer have a bank somewhere that stores all user received money? Is it redirected another payment system with an API, like MasterCard? In your answers, please provide an example scenario.