Of course there is. There are multiple other ways that Apple and Google could decide to charge application providers, but they've decided this one makes them the most money.
They could have a standing charge for each app, with charges per thousand downloads, for instance, which would more closely follow their actual costs, and charge 5% for payments. That would have a different set of positives and negatives, but the way they've chosen is just one way amongst many options they've got.