How CVX solves the maximum value of the difference between two concave functions?
CVX does not do this automatically for you. You can apply Difference of Convex Programming (convex-concave procedure) https://web.stanford.edu/~boyd/papers/pdf/cvx_ccv.pdf .
cvxpy can apply this automatically. using the DCCP extension https://github.com/cvxgrp/dccp
Can matlab solve the problem of calculating the maximum value of concave function minus concave function?
This can’t be done automatically in any MATLAB tool I am aware of. However, CVX can be used to implement the convex-concave procedure described in the ffrst link. Note that maximizing concave minus concave is basically the same as minimizing convex minus convex, accomplished by negating the objective function.