As stated in the specification
The calc() function calculates the expression with all components computed.
It's important to note that percentages are not resolved at computed-value time, therefore they are not resolved in calc() expressions. For example, calc(100% - 100% + 1em) resolves to calc(1em + 0%), not simply 1em. Special rules for computing percentages in a value apply when a calc() expression contains percentages.
When using percentages inside calc(), they behave as if you aren't using calc() at all. So, width:100% is the same as width:calc(100%) which is also equivalent to calc(50% + 50%). When adding another unit like width:calc(100% - 2em), it calculates as width:100% and then subtracts 2em from it.
In essence, calc() is helpful when combining percentage and non-percentage values to achieve precise results, such as removing 10px from 50% of the total width with width:calc(50% - 10px).
What if you need to perform calculations based on a different property? Like setting the width based on a calculation involving height?
This cannot be done with calc(). CSS does not allow for such operations. One could explore using JavaScript, implementing hacks to maintain ratios between width and height, or utilizing CSS variables to assign the same value to multiple properties.
Check out this related question where the misuse of calc() combined with CSS variable is discussed: Calc() outputting unexpected value