It's estimated via a model. We don't actually know the value of all economic activities happening in the country. We just have statisticians survey some fraction of businesses on how they're doing, and plug those result into a model to estimate how the entire country's doing.
GDP is a metric. The specific way in which we construct it is based on a small zoo of models, each working to estimate a myriad of parameters.