If bitcoins price is $1 per btc and there are 16 million of them the market cap is 16 million. If Bitcoin price is $1000 per btc and there are 16 million of them the market cap is 16 billion.
Bitcoin currently costs $1,230 the market cap is $20 billion.
it is a simple formula with 2 variables and although one of these variables (number of coins) is seemingly fixed, in altcoins that variable is a tool for manipulation and that is exactly what ethereum used.
to make it simple and similar to the example you gave:
if price of bitcoin was $1000 and the person who wrote the code changed some variables in the code so that instead of 21 million max we had unlimited supply and instead of a distribution of coins with a logical speed we had 90 million coins the marketcap would have been 80,000 million (80 billion dollar)
and that is what altcoins such as eth do.