Gross Domestic Product can be calculated in several ways, the most common of which is by market value. If the GDP of Ruritania for 2019 is $100 billion, therefore, this means that the total market value of all goods and services produced within the borders of Ruritania in 2019 was $100 billion. However, another way of calculating GDP is by spending. In this model, all the spending on goods and services in Ruritania in 2019 is added together. The five categories of spending are consumption, investment, imports, exports, and government spending. This is often called the "expenditures approach" to GDP.
Whether one makes the calculation using market value, expenditure, or another approach, the focus is on production. However, a lot of government spending does not go to create products. One example is social security, which is known as a "transfer payment," a direct transfer of money from government to an individual, which is not exchanged for any goods or services. This money will eventually be included in GDP when the individual spends it. However, it will usually then be part of the consumption category of GDP (assuming that the individual in receipt of the payment spends it on consumer goods and services) and not part of government spending.