Confused about Market Cap
These are probably dumb questions but I'm confused.
The news announced that Amazon hit a $1 trillion dollar valuation this year when its market cap hit $1 trillion but market cap is just shares outstanding x share price. Shouldn't this mean that it was valued at more than a $1 trillion at the time since some shares privately owned and were in treasury stock?
Also, a massive share buyback would greatly decrease shares outstanding, so it would also greatly decrease market cap. So market cap is not what the firm is valued at because that would make no sense, right? Then why do people use market cap interchangeably with what a company is valued at?