How does Scott or Hope stay thr same strength when small but become stronger when big?

I do think rules need to be set for magic, but MCU science can be just as insane.