Based on the information and my understanding, most often the money on the two-sided marketplace goes directly to the seller's bank account (minus the fees of the provider) after the buyer received service/product.
Is it legally possible to add money to the balance so the seller can later buy someone else's service/product with the money he earned?
There are legal, regulatory and risk implications to retaining and handling funds as a marketplace.
The good thing is with marketplace platforms becoming more mainstream, the payment solutions ( such as Stripe, BrainTree, WePay etc) have also evolved to support their unique needs/services provided.
Depending upon your marketplace model you could choose to just transfer funds to the Seller minus your fees/commission OR hold onto funds (for a certain period) giving your users the ability to withdraw funds upon their choosing.
The payment solutions you choose vary by the use case, and the solution providers take responsibility for legal, regulatory and risk implications.
I have experience in payments for maketplaces and would be happy to share more feedback and suitable solutions over a call.