When the Fed buys assets (known as QE), new money is injected into the economy. This is because the Fed pays for these assets with money that doesn’t otherwise exist. This activity is inflationary by nature.
When the Fed either slows or stops buying assets (QT), the sellers who were previously able to sell to the Fed must now find a buyer in the market with real money to purchase whatever garbage they are selling. This activity is deflationary by nature… but only until the balance sheet has been fully sold off (or allowed to mature).
There is also another equally-as-powerful tool the Fed has as it both expands and reduces its balance sheet as described above - because it has unlimited purchasing power and primarily buys US Treasury debt, it can essentially control the prices (and thus yields) at which Treasury bonds trade at. This is powerful because all risk assets (any investment that is not backed by the “full faith and credit” of the US government) derives value as a function of US treasury yield (also known in a business case as “risk free rate”).
For example, let’s say something you own that you are asking people to invest in is supposed to yield 8% when Treasury yields were at 2%. But now they are at 3.5%. Your investors will now expect to earn more for the risk of holding your asset vs. a very secure 3.5% available from Uncle Sam.